Submission #975301

# Submission time Handle Problem Language Result Execution time Memory
975301 2024-05-04T17:39:55 Z vjudge1 Trol (COCI19_trol) C++17
0 / 50
1 ms 348 KB
#include<bits/stdc++.h>
#define pii pair<int,int>
#define fi first
#define se second
#define int long long
using namespace std;
const int maxn=1e5+5;
signed main() {
	int q; cin>>q;
	while(q--) {
		int l,r; cin>>l>>r;
		int k=(r/9)*45;
		int mk=((r%9)*((r%9)+1))/2;
		int j=((l-1)/9)*45;
		int mj=(((l-1)%9)*(((l-1)%9)+1))/2;
		cout<<k+mk-j+mj<<"\n";
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 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 Incorrect 1 ms 344 KB Output isn't correct
5 Incorrect 1 ms 348 KB Output isn't correct