QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#75382 | #5149. Best Carry Player | chris_pher | TL | 0ms | 3360kb | C++23 | 526b | 2023-02-05 03:46:48 | 2023-02-05 03:46:49 |
Judging History
answer
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int N = 100010;
int main()
{
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int T;
cin >> T;
while(T--) {
int n;
ll ans = 0,sum = 0;
cin >> n;
for(int i = 0;i < n;i++) {
ll x;
cin >> x;
string s = to_string(x);
for(auto i : s) {
ans += i - '0';
}
sum += x;
}
string s = to_string(sum);
for(auto i : s) {
ans -= i -'0';
}
cout << ans / 9 << endl;
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3360kb
input:
2 3 9 99 999 1 12345
output:
5 0
result:
ok 2 number(s): "5 0"
Test #2:
score: -100
Time Limit Exceeded
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 ...