QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#661288 | #5149. Best Carry Player | Tytytony# | WA | 108ms | 3636kb | C++23 | 674b | 2024-10-20 15:38:52 | 2024-10-20 15:38:53 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#define N 100010
#define ll long long
using namespace std;
ll n,b[20],ans;
char a[N][20];
ll c[20];
int main(){
int T; cin>>T;
c[0]=1;
for(int i=1;i<18;i++) c[i]=c[i-1]*10;
while(T--){
cin>>n;
ans=0;
for(int i=0;i<20;i++){
b[i]=0;
}
for(int i=0;i<n;i++){
cin>>a[i];
ll cnt=0;
for(int j=0;a[i][j]!=0;j++) cnt++;
for(int j=0;j<cnt;j++){
b[j]+=a[i][cnt-j-1]-'0';
}
}
for(int i=0;i<17;i++){
ans+=b[i]/10;
for(int j=i+1;j<17;j++){
b[j]+=b[i]/c[j-i];
}
}
cout<<ans<<endl;
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3564kb
input:
2 3 9 99 999 1 12345
output:
5 0
result:
ok 2 number(s): "5 0"
Test #2:
score: 0
Accepted
time: 108ms
memory: 3592kb
input:
100000 1 481199252 1 634074578 1 740396295 1 579721198 1 503722503 1 202647942 1 268792718 1 443917727 1 125908043 1 717268783 1 150414369 1 519096230 1 856168102 1 674936674 1 274667941 1 527268921 1 421436316 1 286802932 1 646837311 1 451394766 1 105650419 1 302790137 1 254786900 1 76141081 1 7393...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 100000 numbers
Test #3:
score: 0
Accepted
time: 15ms
memory: 3592kb
input:
10000 10 598196518 640274071 983359971 71550121 96204862 799843967 446173607 796619138 402690754 223219513 10 312183499 905549873 673542337 566661387 879397647 434495917 631413076 150918417 579868000 224422012 10 525305826 535526356 404334728 653535984 998133227 879226371 59632864 356493387 62611196...
output:
42 41 42 35 43 35 44 38 39 46 31 40 42 38 38 41 39 39 37 42 38 41 38 42 41 39 40 45 35 41 37 40 41 41 40 35 50 39 42 33 44 43 46 41 35 42 39 41 39 38 34 44 39 43 38 40 41 36 35 45 37 39 40 41 43 44 41 43 40 42 37 41 38 43 40 40 42 42 41 40 37 41 36 42 41 40 44 35 37 43 40 36 36 43 41 41 43 44 32 38 ...
result:
ok 10000 numbers
Test #4:
score: -100
Wrong Answer
time: 16ms
memory: 3636kb
input:
1000 95 708441014 953465932 817091665 611120528 186861396 45214633 309108293 362222948 134971428 346366757 945798520 132315932 293683620 945425590 668726142 893155157 191896353 57521218 112217858 641511394 672365121 156197927 495345729 585777737 567289722 592583094 842472845 908714567 355422360 5153...
output:
426 417 411 423 425 432 442 461 446 427 418 442 440 417 434 432 457 415 428 423 441 441 448 424 419 415 413 413 437 420 427 420 440 438 437 418 433 451 443 418 451 415 443 414 448 445 457 420 401 447 419 407 436 400 454 438 429 402 456 428 405 447 444 416 406 401 429 420 433 440 429 428 429 450 430 ...
result:
wrong answer 1st numbers differ - expected: '421', found: '426'