QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#95730 | #5577. Alchemy | Username# | WA | 2ms | 3404kb | C++14 | 614b | 2023-04-11 18:37:18 | 2023-04-11 18:37:20 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
void test_case() {
int n, k, ans = 0;
cin >> n >> k;
int current = 0;
for (int i = 1; i <= n; ++i) {
int x = i, pw = 1;
while (x) {
pw = (10ll * pw) % k;
x /= 10;
}
current = (1ll * pw * current + i) % k;
ans += (current == 0);
}
cout << ans << '\n';
}
int main() {
ios::sync_with_stdio(false); cout.tie(nullptr); cin.tie(nullptr);
test_case();
// int tc; cin >> tc;
// while (tc--) {
// test_case();
// }
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3356kb
input:
ioi
output:
0
result:
ok single line: '0'
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 3404kb
input:
noi
output:
0
result:
wrong answer 1st lines differ - expected: '1', found: '0'