ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#211092 | #3800. 蛋糕 | 18915523188 | 15 | 3ms | 1248kb | C++ | 1.0kb | 2024-08-09 11:18:49 | 2024-08-09 12:46:30 |
answer
#include<bits/stdc++.h>
#pragma GCC optimeze(2)
#define ll long long
using namespace std;
ll T=18,l,t,t2,t5,t10;
ll f(ll x,ll p){
ll ans;
while(p){
if(p&1){
ans*=x;
}
p>>=1;
x*=x;
}
return ans;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
while(T--){
cin>>l>>t;
if(l%t==0){
cout<<l/t<<endl;
continue;
}
if(t=999){
cout<<l/999<<" .("<<l%999<<")"<<endl;
continue;
}
if(t=9999){
cout<<l/9999<<".("<<l%9999<<")"<<endl;
continue;
}
if(t=99999){
cout<<l/99999<<".("<<l%99999<<")"<<endl;
continue;
}
while(t%2){
t/=2;
t2++;
}
while(t%5){
t/=5;
if(t2){
t10++;
t2--;
continue;
}
t5++;
}
if(t==1){
while(t2){
t2--;
l*=5;
if(l%10){
t10++;
}else{
l/=10;
}
}
while(t5){
t5--;
l*=2;
if(l%10){
t10++;
}else{
l/=10;
}
}
t10=f(10,t10);
cout<<l/t10<<"."<<l%t10<<endl;
}
}
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 5
Accepted
time: 0ms
memory: 1248kb
input:
85 85 59 59 52 52 96 12 62 31 48 24 85 85 85 85 69 69 76 38 72 24 54 27 100 20 72 72 42 42 81 81 78 ...
output:
1 1 1 8 2 2 1 1 1 2 3 2 5 1 1 1 1 1
result:
ok 18 tokens
Test #2:
score: 5
Accepted
time: 0ms
memory: 1248kb
input:
9696 9696 9036 9036 4771 4771 7751 7751 9073 9073 9085 9085 6444 358 4581 4581 8505 8505 8028 2007 9...
output:
1 1 1 1 1 1 18 1 1 4 2 5 2 1 1 1 1 1
result:
ok 18 tokens
Test #3:
score: 5
Accepted
time: 0ms
memory: 1248kb
input:
648044 648044 949839 949839 401844 401844 916962 916962 875649 875649 227737 227737 827552 827552 64...
output:
1 1 1 1 1 1 1 1 1 1 2 7 2 2 5 2 1 2
result:
ok 18 tokens
Test #4:
score: 0
Wrong Answer
time: 0ms
memory: 1248kb
input:
37 25 43 10 56 10 47 2 50 50 66 80 34 50 3 8 56 1 49 10 97 5 10 1 76 40 52 50 70 5 26 1 97 32 32 64
output:
0 .(37) 0 .(43) 0 .(56) 0 .(47) 1 0 .(66) 0 .(34) 0 .(3) 56 0 .(49) 0 .(97) 10 0 .(76) 0 .(52) 14 26...
result:
wrong answer 1st words differ - expected: '1.48', found: '0'
Test #5:
score: 0
Wrong Answer
time: 1ms
memory: 1244kb
input:
451 100 844 50 744 100 874 8 19 625 443 400 415 512 766 625 189 5 71 128 247 80 307 640 395 160 101 ...
output:
0 .(451) 0 .(844) 0 .(744) 0 .(874) 0 .(19) 0 .(443) 0 .(415) 0 .(766) 0 .(189) 0 .(71) 0 .(247) 0 ....
result:
wrong answer 1st words differ - expected: '4.51', found: '0'
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 1244kb
input:
7819 400 2868 512 4833 800 6024 6250 3285 8000 9721 125 4037 6250 8159 1250 4544 3125 6659 5000 8331...
output:
7 .(826) 2 .(870) 4 .(837) 6 .(30) 3 .(288) 9 .(730) 4 .(41) 8 .(167) 4 .(548) 6 .(665) 8 .(339) 6 ....
result:
wrong answer 1st words differ - expected: '19.5475', found: '7'
Test #7:
score: 0
Wrong Answer
time: 1ms
memory: 1248kb
input:
562036 800 494900 160000 710305 4096 549145 125000 277786 125 375881 390625 992034 2 702342 3125 569...
output:
562 .(598) 495 .(395) 711 .(16) 549 .(694) 278 .(64) 376 .(257) 496017 703 .(45) 570 .(475) 736 .(97...
result:
wrong answer 1st words differ - expected: '702.545', found: '562'
Test #8:
score: 0
Wrong Answer
time: 0ms
memory: 1248kb
input:
910 999 944 999 1978 999 581 999 482 999 380 999 130 999 838 999 326 999 1097 999 568 999 358 999 11...
output:
0 .(910) 0 .(944) 1 .(979) 0 .(581) 0 .(482) 0 .(380) 0 .(130) 0 .(838) 0 .(326) 1 .(98) 0 .(568) 0 ...
result:
wrong answer 1st words differ - expected: '0.(910)', found: '0'
Test #9:
score: 0
Wrong Answer
time: 0ms
memory: 1248kb
input:
8452 9999 4205 9999 4177 9999 73522 9999 2260 9999 9992 9999 45229 9999 6275 9999 1886 9999 63203 99...
output:
8 .(460) 4 .(209) 4 .(181) 73 .(595) 2 .(262) 10 .(2) 45 .(274) 6 .(281) 1 .(887) 63 .(266) 7 .(2) 0...
result:
wrong answer 1st words differ - expected: '0.(8452)', found: '8'
Test #10:
score: 0
Wrong Answer
time: 0ms
memory: 1248kb
input:
652832 99999 86603 99999 698815 99999 733498 99999 81815 99999 208109 99999 37024 99999 4883 99999 7...
output:
653 .(485) 86 .(689) 699 .(514) 734 .(232) 81 .(896) 208 .(317) 37 .(61) 4 .(887) 744 .(857) 88 .(4)...
result:
wrong answer 1st words differ - expected: '6.(52838)', found: '653'
Test #11:
score: 0
Wrong Answer
time: 0ms
memory: 1248kb
input:
103 491 83 1 114 757 214 7 851 243 672 391 532 3 130 61 385 577 119 233 398 241 607 559 460 1 3 717 ...
output:
0 .(103) 83 0 .(114) 0 .(214) 0 .(851) 0 .(672) 0 .(532) 0 .(130) 0 .(385) 0 .(119) 0 .(398) 0 .(607...
result:
wrong answer 1st words differ - expected: '0.(209775967413441955193482688...926680244399185336048879...
Test #12:
score: 0
Wrong Answer
time: 0ms
memory: 1244kb
input:
4173 2067 5038 4221 9002 4023 5399 8061 3182 4767 6110 1191 2345 1919 2234 8581 2139 4047 5103 8841 ...
output:
4 .(177) 5 .(43) 9 .(11) 5 .(404) 3 .(185) 6 .(116) 2 .(347) 2 .(236) 2 .(141) 5 .(108) 5 .(914) 7 ....
result:
wrong answer 1st words differ - expected: '2.(0188679245283)', found: '4'
Test #13:
score: 0
Wrong Answer
time: 0ms
memory: 1248kb
input:
122878 63889 743422 282861 708740 16059 224329 125883 600815 5271 229177 746563 135403 246477 916903...
output:
123 .(1) 744 .(166) 709 .(449) 224 .(553) 601 .(416) 229 .(406) 135 .(538) 917 .(820) 454 .(190) 732...
result:
wrong answer 1st words differ - expected: '1.(923304481209597896351484606...955735729155253643037142...
Test #14:
score: 0
Wrong Answer
time: 0ms
memory: 1248kb
input:
792 834 521 262 307 500 269 340 155 96 414 536 173 96 137 735 187 321 577 788 787 958 811 192 563 28...
output:
0 .(792) 0 .(521) 0 .(307) 0 .(269) 0 .(155) 0 .(414) 0 .(173) 0 .(137) 0 .(187) 0 .(577) 0 .(787) 0...
result:
wrong answer 1st words differ - expected: '0.(9496402877697841726618705035971223021582733812)', foun...
Test #15:
score: 0
Wrong Answer
time: 0ms
memory: 1244kb
input:
1985 1210 1986 723 1986 628 1988 52 1991 1026 1989 519 1989 1226 1989 21 1984 712 1996 27 1996 816 1...
output:
1 .(986) 1 .(987) 1 .(987) 1 .(989) 1 .(992) 1 .(990) 1 .(990) 1 .(990) 1 .(985) 1 .(997) 1 .(997) 1...
result:
wrong answer 1st words differ - expected: '1.6(4049586776859504132231)', found: '1'
Test #16:
score: 0
Wrong Answer
time: 0ms
memory: 1244kb
input:
9941 8960 4951 2688 5659 3776 6203 4096 3449 8816 1517 2269 8977 5183 4189 3777 4928 9496 37 9552 89...
output:
9 .(950) 4 .(955) 5 .(664) 6 .(209) 3 .(452) 1 .(518) 8 .(985) 4 .(193) 4 .(932) 0 .(37) 8 .(927) 5 ...
result:
wrong answer 1st words differ - expected: '1.10948660(714285)', found: '9'
Test #17:
score: 0
Wrong Answer
time: 1ms
memory: 1244kb
input:
80258 62742 8017 18626 10499 36864 27011 55552 32593 37660 61539 72315 2281 51248 45697 64256 3866 3...
output:
80 .(338) 8 .(25) 10 .(509) 27 .(38) 32 .(625) 61 .(600) 2 .(283) 45 .(742) 3 .(869) 45 .(872) 38 .(...
result:
wrong answer 1st words differ - expected: '1.(279175034267316948774345733...800930795958050428739919...
Test #18:
score: 0
Wrong Answer
time: 0ms
memory: 1244kb
input:
50937 87224 94005 68794 95287 97008 56806 11386 84920 37159 65243 1776 42961 26609 62779 4311 56039 ...
output:
50 .(987) 94 .(99) 95 .(382) 56 .(862) 85 .(5) 65 .(308) 43 .(4) 62 .(841) 56 .(95) 46 .(536) 54 .(2...
result:
wrong answer 1st words differ - expected: '0.583(979180042190222874438228...451802256259745024305237...
Test #19:
score: 0
Wrong Answer
time: 0ms
memory: 1244kb
input:
1000000 999983 999999 999983 999998 999983 999997 999983 999996 999983 999995 999983 999994 999983 9...
output:
1001 .(1) 1001 .(0) 1000 .(998) 1000 .(997) 1000 .(996) 1000 .(995) 1000 .(994) 1000 .(993) 1000 .(9...
result:
wrong answer 1st words differ - expected: '1.(000017000289004913083522419...247686210665581314882353...
Test #20:
score: 0
Wrong Answer
time: 0ms
memory: 1248kb
input:
426133 364441 128599 195258 959887 821056 929791 105216 155657 164864 813863 352256 552086 307253 21...
output:
426 .(559) 128 .(727) 960 .(847) 930 .(721) 155 .(812) 814 .(677) 552 .(638) 214 .(972) 738 .(305) 3...
result:
wrong answer 1st words differ - expected: '1.(169278429155885314769743250...778828397463512612466764...