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