2803 Alice Magteroyd

Source: Internet
Author: User
Tags mul

2803 Alice Magteroyd

time limit: 4 sspace limit: 8000 KBtitle level: Golden Gold SolvingView Run ResultsTitle Description Description

In Gensokyo, Alice Magteroyd is a magical man who lives in magical forests and specializes in
Summon a puppet. One day, her "engine oil", she found her, to defend the fog rain Marisa to Bavalou Demon
The "destruction" of the law library.
She has a magic value of N, each summoning a "Shanghai humanoid" consumes several points (x), and finally,
The power they inflict is the total product of the mana consumed by each person's shape.
She found the only one who would program you in order to know how much power she could have, and you wouldn't let her
Disappointed, huh?

Rewrote from Izayoi Sakuya

Enter a description Input Description

N

Output description Output Description

Maximum power

Sample input Sample Input

10

Sample output Sample Output

36

Data range and Tips Data Size & Hint

0<n<10^5

10=2+2+3+3 36=2*2*3*3

Category labels Tags Click here to expandHigh accuracy of open test questions

Exercises

Primary School Olympiad number ...?
3 more or 2.
Listen to the answer, that's it.
Incidentally, high accuracy (+ pressure level)

AC Code:

#include <cstdio>#include<cmath>intn,a[ -];inlinevoidMulintt) {    intj=0;  for(intI=1; i<=a[0]+1; i++) {A[i]=a[i]*t+J; J=0; if(a[i]>=100000000) {J=a[i]/100000000; A[i]=a[i]%100000000; }    }    if(a[a[0]+1]>0) a[0]++;} InlinevoidZerointp) {     for(intq=8-LOG10 (P); q;q--) printf ("0");}intMain () {scanf ("%d",&N); if(n<=4) printf ("%d", N); Else{a[1]=3; a[0]=1; if(n%3==0) for(intk=n/3-1;k>0; k--) Mul (3); if(n%3==1){             for(intK= (n4)/3-1;k>0; k--) Mul (3); Mul (2); Mul (2); }        if(n%3==2){             for(intK= (n2)/3-1;k>0; k--) Mul (3); Mul (2); } printf ("%d", a[a[0]]);  for(intk=a[0]-1; k>=1; k--) {zero (a[k]); printf ("%d", A[k]); }    }    return 0;}

2803 Alice Magteroyd

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.