# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
338931 | 2020-12-24T09:55:33 Z | A_D | Trol (COCI19_trol) | C++14 | 1 ms | 364 KB |
#include <bits/stdc++.h> #define ll long long #define F first #define S second using namespace std; ll f(int v) { if(v==0)return 0; ll k=v/9; ll ret=k*(9*10)/2; v%=9; ret+=v*(v+1)/2; return ret; } main() { int q; cin>>q; while(q--) { ll l,r; cin>>l>>r; cout<<f(r)-f(l-1)<<endl; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Incorrect | 1 ms | 364 KB | Output isn't correct |
4 | Correct | 1 ms | 364 KB | Output is correct |
5 | Incorrect | 1 ms | 364 KB | Output isn't correct |