QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#323294#5581. Champernowne CountqyockeyWA 0ms3664kbC++14958b2024-02-09 07:06:482024-02-09 07:06:48

Judging History

你现在查看的是最新测评结果

  • [2024-02-09 07:06:48]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3664kb
  • [2024-02-09 07:06:48]
  • 提交

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'