# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
485822 | groupATSU | Trol (COCI19_trol) | C++14 | 1 ms | 316 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf=1e9;
const int maxn=100;
const ll mod=998244353;
int dp[maxn][maxn];
void solve(){
int l,r;
cin>>l>>r;
l--;
int c=r%9;
int c1=l%9;
int x1=(r/9)+(c*(c+1))/2;
int x2=(l/9)+(c1*(c1+1))/2;
cout<<x1-x2;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t=1;
cin>>t;
while(t--){
solve();
cout<<'\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |