# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
971307 |
2024-04-28T11:07:19 Z |
vjudge1 |
Trol (COCI19_trol) |
C++11 |
|
1000 ms |
348 KB |
#include <bits/stdc++.h>
#define ull unsigned long long
using namespace std;
int convert( ull x) {
int sum = 0;
while( x >= 1) {
int temp = x % 10;
sum+= temp;
x/=10;
}
return sum % 9;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int q; cin >> q;
while( q--) {
ull l,r, sum = 0; cin >> l >> r;
for( ull i = l; i <= r; i++) {
int y = convert(i);
// cout << y << ' ';
sum+=y;
}
cout << sum << "\n";
}
//cout << convert(2024);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
4 |
Execution timed out |
1056 ms |
348 KB |
Time limit exceeded |
5 |
Execution timed out |
1004 ms |
348 KB |
Time limit exceeded |