mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 18:52:02 +00:00
P4942 小凯的数字
R56613060
This commit is contained in:
parent
f593a4176c
commit
bbaeaa0472
16
Luogu/problem/P4942/P4942.cpp
Normal file
16
Luogu/problem/P4942/P4942.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int t;
|
||||
long long l, r, c;
|
||||
|
||||
int main() {
|
||||
cin >> t;
|
||||
while (t--) {
|
||||
cin >> l >> r;
|
||||
c = (r - l + 1) % 9;
|
||||
cout << (c * (l % 9) % 9 + c * (c - 1) % 9 * 5 % 9) % 9 << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user