QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#691061 | #7658. German Conference for Public Counting | ptit_noodles | WA | 0ms | 3656kb | C++20 | 705b | 2024-10-31 09:37:45 | 2024-10-31 09:37:46 |
Judging History
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'