QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#691061#7658. German Conference for Public Countingptit_noodlesWA 0ms3656kbC++20705b2024-10-31 09:37:452024-10-31 09:37:46

Judging History

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

  • [2024-10-31 09:37:46]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3656kb
  • [2024-10-31 09:37:45]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define ii pair<int, int>
#define x first
#define y second
const int N = 1e5+5, M = 1e3+5, inf = 1e18, MOD = 998244353;
int n, m, x, y, res, k, cnt, sum, test;
int a[N], b[N], f[27][N][18], Min[N][27], d[N][27];
char c[N];

signed main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for (int i = 1; i <= 9; ++i) {
        x = 0;
        while (1) {
            x = x * 10 + i;
            if (x > n) break;
            ++res;
        }
    }
    x = 1;
    while (1) {
        x = x * 10;
        if (x > n) break;
        ++res;
    }
    cout << res;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3656kb

input:

5

output:

5

result:

wrong answer 1st lines differ - expected: '6', found: '5'