QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#323294 | #5581. Champernowne Count | qyockey | WA | 0ms | 3664kb | C++14 | 958b | 2024-02-09 07:06:48 | 2024-02-09 07:06:48 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define lrep(i, a, b) for (ll i = a; i < (b); ++i)
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define ia(n) std::array<int, n>
#define lla(n) std::array<ll, n>
using vi = std::vector<int>;
using pii = std::pair<int, int>;
using ll = long long;
using vll = std::vector<ll>;
using pll = std::pair<ll, ll>;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
ll word = 0;
ll power = 10;
ll count = 0;
ll n;
ll k;
cin >> n >> k;
lrep (i, 1, n) {
if (i == power) {
power *= 10;
}
word = ((word * power) + i) % k;
if (word == 0) {
++count;
}
}
cout << count << '\n';
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3664kb
input:
4 2
output:
1
result:
wrong answer 1st lines differ - expected: '2', found: '1'