# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
975436 |
2024-05-05T07:24:24 Z |
vjudge1 |
Trol (COCI19_trol) |
C++17 |
|
1000 ms |
452 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define Foxfur ios_base::sync_with_stdio(0);cin.tie(NULL);
int32_t main()
{
Foxfur
int q; cin >> q;
while(q--)
{
int l,r; cin >> l >> r;
/*tmpl = ((l-1)*l)/2;
tmpr = (r*(r+1))/2;
int jml = r/9;*/
int ans = 0;
for(int i=l; i<=r; i++)
{
int x=i;
if(x%9==0){
ans +=9;
continue;
}
ans+=x%9;
}
//int ans = (tmpr-tmpl);
cout << ans << endl;;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
452 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Execution timed out |
1079 ms |
348 KB |
Time limit exceeded |
5 |
Execution timed out |
1027 ms |
344 KB |
Time limit exceeded |