# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
976952 |
2024-05-07T09:36:44 Z |
vjudge1 |
Trol (COCI19_trol) |
C++17 |
|
1000 ms |
348 KB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
int num(int n){
if (n < 9)
return n;
if (n % 9 == 0)
return n % 9 + 1;
return n % 9;
}
int f(int a, int b){
int result = 0;
for (int i = a; i <= b; i++)
result += num(i);
return result;
}
signed main(){
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int t; cin >> t;
while(t--){
int a, b; cin >> a >> b;
cout << f(a, b) << endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
4 |
Execution timed out |
1044 ms |
344 KB |
Time limit exceeded |
5 |
Execution timed out |
1050 ms |
348 KB |
Time limit exceeded |