problem_id stringlengths 6 6 | buggy_code stringlengths 8 526k ⌀ | fixed_code stringlengths 12 526k ⌀ | labels listlengths 0 15 ⌀ | buggy_submission_id int64 1 1.54M ⌀ | fixed_submission_id int64 2 1.54M ⌀ | user_id stringlengths 10 10 ⌀ | language stringclasses 9 values |
|---|---|---|---|---|---|---|---|
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
if (N < 9) {
cout << N << endl;
} else if (9 <= N && N <= 99) {
cout << 9 << endl;
} else if (100 <= N && N < 999) {
cout << N - 90 << endl;
} else if (999 <= N && N <= 9999) {
cout << 909 << endl;
} else if (10000 <= N && 99999) {
cout << N - 9090 << endl;
} else {
cout << 90909 << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
if (N < 9) {
cout << N << endl;
} else if (9 <= N && N <= 99) {
cout << 9 << endl;
} else if (100 <= N && N < 999) {
cout << N - 90 << endl;
} else if (999 <= N && N <= 9999) {
cout << 909 << endl;
} else if (10000 <= N && N < 99999) {
cout << N - 9090 << endl;
} else {
cout << 90909 << endl;
}
} | [
"control_flow.branch.if.condition.change"
] | 754,550 | 754,551 | u275786410 | cpp |
p02952 | #include <iostream>
#include <string>
using namespace std;
int main() {
int n, ans = 0;
cin >> n;
int i;
for (i = 1; i < n; i++) {
string s;
s = to_string(i);
if (s.length() % 2 == 1)
ans++;
}
cout << ans << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
int n, ans = 0;
cin >> n;
int i;
for (i = 1; i <= n; i++) {
string s;
s = to_string(i);
if (s.length() % 2 == 1)
ans++;
}
cout << ans << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 754,559 | 754,560 | u110383054 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int count_digit(int i) {
int rem, count = 0;
while (i != 0) {
rem = i % 10;
i = i / 10;
count++;
}
return count;
}
int main() {
int n;
cin >> n;
int p, c = 0;
for (int i = 1; i < n; i++) {
p = count_digit(i);
if (p % 2 == 1)
c++;
}
cout << c;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int count_digit(int i) {
int rem, count = 0;
while (i != 0) {
rem = i % 10;
i = i / 10;
count++;
}
return count;
}
int main() {
int n;
cin >> n;
int p, c = 0;
for (int i = 1; i <= n; i++) {
p = count_digit(i);
if (p % 2 == 1)
c++;
}
cout << c;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 754,570 | 754,571 | u507023703 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int odds[] = {9, 90, 900, 9000, 90000};
int start[] = {1, 10, 100, 1000, 10000};
int n, d = 0, n2;
cin >> n;
n2 = n;
while (n > 0) {
n /= 10;
d++;
}
long long ans = 0;
if (d % 2 == 0) {
d -= 2;
while (d >= 0) {
ans += odds[d];
d -= 2;
}
} else {
ans += (n2 - start[d - 1]);
d -= 3;
while (d >= 0) {
ans += odds[d];
d -= 2;
}
}
cout << ans << "\n";
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int odds[] = {9, 90, 900, 9000, 90000};
int start[] = {1, 10, 100, 1000, 10000};
int n, d = 0, n2;
cin >> n;
n2 = n;
while (n > 0) {
n /= 10;
d++;
}
long long ans = 0;
if (d % 2 == 0) {
d -= 2;
while (d >= 0) {
ans += odds[d];
d -= 2;
}
} else {
ans += (n2 - start[d - 1]) + 1;
d -= 3;
while (d >= 0) {
ans += odds[d];
d -= 2;
}
}
cout << ans << "\n";
} | [
"assignment.change"
] | 754,590 | 754,591 | u742437982 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int odds[] = {9, 90, 900, 9000, 90000};
int start[] = {1, 10, 100, 1000, 10000};
int n, d = 0, n2;
cin >> n;
n2 = n;
while (n > 0) {
n /= 10;
d++;
}
int ans = 0;
if (d % 2 == 0) {
d -= 2;
while (d >= 0) {
ans += odds[d];
d -= 2;
}
} else {
ans += (n2 - start[d - 1]);
d -= 3;
while (d >= 0) {
ans += odds[d];
d -= 2;
}
}
cout << ans << "\n";
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int odds[] = {9, 90, 900, 9000, 90000};
int start[] = {1, 10, 100, 1000, 10000};
int n, d = 0, n2;
cin >> n;
n2 = n;
while (n > 0) {
n /= 10;
d++;
}
long long ans = 0;
if (d % 2 == 0) {
d -= 2;
while (d >= 0) {
ans += odds[d];
d -= 2;
}
} else {
ans += (n2 - start[d - 1]) + 1;
d -= 3;
while (d >= 0) {
ans += odds[d];
d -= 2;
}
}
cout << ans << "\n";
} | [
"variable_declaration.type.primitive.change",
"variable_declaration.type.widen.change",
"assignment.change"
] | 754,592 | 754,591 | u742437982 | cpp |
p02952 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
int n, count = 0;
cin >> n;
for (int i = 0; i < n; i++) {
if (int(log10(i)) % 2 != 1)
count++;
}
if (int(log10(n)) % 2 == 1)
count++;
cout << count << endl;
return 0;
}
| #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
int n, count = 0;
cin >> n;
for (int i = 0; i < n; i++) {
if (int(log10(i)) % 2 != 1)
count++;
}
if (int(log10(n)) % 2 == 1)
count--;
cout << count << endl;
return 0;
} | [] | 754,601 | 754,602 | u532401120 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int count = 0;
for (int i = 0; i <= N; i++) {
if (to_string(i).size() % 2 != 0) {
count++;
}
}
cout << count << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int count = 0;
for (int i = 1; i <= N; i++) {
if (to_string(i).size() % 2 != 0) {
count++;
}
}
cout << count << endl;
} | [
"literal.number.change",
"variable_declaration.value.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one"
] | 754,640 | 754,641 | u111600809 | cpp |
p02952 | #include <cstdio>
#include <string>
using namespace std;
main() {
int n;
scanf("%d", &n);
int ans = 0;
for (int i = 1; i < n; i++) {
if (to_string(i).size() % 2 == 1)
ans++;
}
printf("%d\n", ans);
return 0;
} | #include <cstdio>
#include <string>
using namespace std;
main() {
int n;
scanf("%d", &n);
int ans = 0;
for (int i = 1; i <= n; i++) {
if (to_string(i).size() % 2 == 1)
ans++;
}
printf("%d\n", ans);
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 754,648 | 754,649 | u468811760 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int digit(int n) {
int d = 0;
while (n > 0) {
n /= 10;
d++;
}
return d;
}
int main() {
int n, s = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
if (digit(n) % 2 == 1)
s++;
}
cout << s << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int digit(int n) {
int d = 0;
while (n > 0) {
n /= 10;
d++;
}
return d;
}
int main() {
int n, s = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
if (digit(i) % 2 == 1)
s++;
}
cout << s << endl;
}
| [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 754,660 | 754,661 | u697658632 | cpp |
p02952 | #include <iostream>
using namespace std;
bool f(int x) {
int keta = 0;
while (x) {
keta++;
x /= 10;
}
return keta % 2 == 1;
}
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 0; i < n; i++) {
if (f(i))
ans++;
}
cout << ans << endl;
return 0;
} | #include <iostream>
using namespace std;
bool f(int x) {
int keta = 0;
while (x) {
keta++;
x /= 10;
}
return keta % 2 == 1;
}
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; i++) {
if (f(i))
ans++;
}
cout << ans << endl;
return 0;
} | [
"literal.number.change",
"variable_declaration.value.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 754,662 | 754,663 | u855821077 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int ruit(int n, int h) {
int a = 1;
for (int i = 0; i < h; i++) {
a *= n;
}
return a;
}
int main() {
int a;
cin >> a;
int digits = log10(a);
int answer = 0;
for (int i = 0; i <= digits; i += 2) {
if (i == digits) {
answer += a % ruit(10, i) + 1;
} else {
answer += ruit(10, i + 1) - ruit(10, i);
}
}
cout << answer;
} | #include <bits/stdc++.h>
using namespace std;
int ruit(int n, int h) {
int a = 1;
for (int i = 0; i < h; i++) {
a *= n;
}
return a;
}
int main() {
int a;
cin >> a;
int digits = log10(a);
int answer = 0;
for (int i = 0; i <= digits; i += 2) {
if (i == digits) {
answer += (a - ruit(10, i) + 1);
} else {
answer += ruit(10, i + 1) - ruit(10, i);
}
}
cout << answer;
} | [
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 754,666 | 754,667 | u516210981 | cpp |
p02952 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
const int MOD = 1000000007;
int main() {
int N;
cin >> N;
int count = 0;
for (int i = N; i >= 1; i--)
if ((int)(log(i) / log(10)) % 2 == 0)
count++;
cout << count;
}
| #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
const int MOD = 1000000007;
int main() {
int N;
cin >> N;
int count = 0;
for (int i = N; i >= 1; i--) {
if ((int)(log(i) / log(10) + 0.0000001) % 2 == 0)
count++;
}
cout << count;
}
| [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 754,677 | 754,678 | u554988565 | cpp |
p02952 | #include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define INF 110000000000
#define MAX 100000
typedef long long ll;
typedef pair<ll, int> P;
bool check(int x) {
int count = 1;
while (true) {
x /= 10;
if (x == 0)
break;
else
count++;
}
return count % 2;
}
int main() {
int N, ans = 0;
cin >> N;
for (int i = 0; i <= N; i++) {
if (check(i))
ans++;
}
cout << ans << endl;
}
| #include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define INF 110000000000
#define MAX 100000
typedef long long ll;
typedef pair<ll, int> P;
bool check(int x) {
int count = 1;
while (true) {
x /= 10;
if (x == 0)
break;
else
count++;
}
return count % 2;
}
int main() {
int N, ans = 0;
cin >> N;
for (int i = 1; i <= N; i++) {
if (check(i))
ans++;
}
cout << ans << endl;
}
| [
"literal.number.change",
"variable_declaration.value.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one"
] | 754,711 | 754,712 | u591914971 | cpp |
p02952 | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <random>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
int n;
cin >> n;
int cnt = 0;
for (int i = 1; i <= 9 && i <= n; i++) {
cnt++;
}
for (int i = 100; i <= 999 && i <= n; i++) {
cnt++;
}
for (int i = 10000; i < 99999 && i <= n; i++) {
cnt++;
}
cout << cnt << endl;
return 0;
} | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <random>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
int n;
cin >> n;
int cnt = 0;
for (int i = 1; i <= 9 && i <= n; i++) {
cnt++;
}
for (int i = 100; i <= 999 && i <= n; i++) {
cnt++;
}
for (int i = 10000; i <= 99999 && i <= n; i++) {
cnt++;
}
cout << cnt << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 754,737 | 754,738 | u654115954 | cpp |
p02952 | #include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
int main() {
int a;
int count = 0;
cin >> a;
for (int i = 1; i < a; i++) {
if (i / 10 == 0)
count++;
else if (i / 100 >= 1 && i / 100 < 10)
count++;
else if (i / 10000 >= 1 && i / 100000 < 10)
count++;
}
cout << count;
} | #include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
int main() {
int a;
int count = 0;
cin >> a;
for (int i = 1; i < a + 1; i++) {
if (i / 10 == 0)
count++;
else if (i / 100 >= 1 && i / 100 < 10)
count++;
else if (i / 10000 >= 1 && i / 10000 < 10)
count++;
}
cout << count;
} | [
"control_flow.loop.for.condition.change",
"misc.off_by_one",
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 754,776 | 754,777 | u540741303 | cpp |
p02952 | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int result = 0;
for (int i = 0; i <= n; ++i) {
if (0 < i && i < 10) {
result++;
continue;
}
if (100 < i && i < 1000) {
result++;
continue;
}
if (10000 < i && i < 100000) {
result++;
continue;
}
}
cout << result << endl;
} | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int result = 0;
for (int i = 0; i <= n; ++i) {
if (0 < i && i < 10) {
result++;
continue;
}
if (100 <= i && i < 1000) {
result++;
continue;
}
if (10000 <= i && i < 100000) {
result++;
continue;
}
}
cout << result << endl;
} | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 754,790 | 754,791 | u826144345 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; i++) {
int dig = to_string(i).length();
if (dig % 2 == 0) {
ans++;
}
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; i++) {
int dig = to_string(i).length();
if (dig % 2 == 1) {
ans++;
}
}
cout << ans << endl;
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 754,797 | 754,798 | u653388379 | cpp |
p02952 | #include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int x = 10, res = 0;
while (x < n) {
res += x - x / 10;
x *= 100;
}
if (n >= x / 10)
res += n - x / 10 + 1;
printf("%d\n", res);
return 0;
} | #include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int x = 10, res = 0;
while (x <= n) {
res += x - x / 10;
x *= 100;
}
if (n >= x / 10)
res += n - x / 10 + 1;
printf("%d\n", res);
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 754,805 | 754,806 | u919923389 | cpp |
p02952 | #include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int x = 10, res = 0;
while (x < n) {
res += x - x / 10;
x *= 100;
}
if (n >= x / 10)
res += n - x / 10 + 1;
printf("%d\n", &res);
return 0;
} | #include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int x = 10, res = 0;
while (x <= n) {
res += x - x / 10;
x *= 100;
}
if (n >= x / 10)
res += n - x / 10 + 1;
printf("%d\n", res);
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.condition.change",
"call.arguments.change"
] | 754,807 | 754,806 | u919923389 | cpp |
p02952 | #include <iostream>
using namespace std;
int main(void) {
int N;
cin >> N;
int n = 0;
for (int i = 0; i < N; i++) {
if (0 < i && i < 10) {
n++;
} else if (99 < i && i < 1000) {
n++;
} else if (9999 < i && i < 100000) {
n++;
}
}
cout << n;
}
| #include <iostream>
using namespace std;
int main(void) {
int N;
cin >> N;
int n = 0;
for (int i = 0; i < N + 1; i++) {
if (0 < i && i < 10) {
n++;
} else if (99 < i && i < 1000) {
n++;
} else if (9999 < i && i < 100000) {
n++;
}
}
cout << n;
}
| [
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 754,808 | 754,809 | u968313090 | cpp |
p02952 | #include <iostream>
using namespace std;
int main(void) {
int N;
cin >> N;
int n = 0;
for (int i = 0; i < N; i++) {
if (i < 10) {
n++;
} else if (99 < i && i < 1000) {
n++;
} else if (9999 < i && i < 100000) {
n++;
}
}
cout << n;
}
| #include <iostream>
using namespace std;
int main(void) {
int N;
cin >> N;
int n = 0;
for (int i = 0; i < N + 1; i++) {
if (0 < i && i < 10) {
n++;
} else if (99 < i && i < 1000) {
n++;
} else if (9999 < i && i < 100000) {
n++;
}
}
cout << n;
}
| [
"control_flow.loop.for.condition.change",
"misc.off_by_one",
"control_flow.branch.if.condition.change"
] | 754,811 | 754,809 | u968313090 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int ans = 0;
for (int i = 1; i < 10 && i <= N; i++)
ans++;
for (int i = 100; i < 1000 && i <= N; i++)
ans++;
for (int i = 10000; i < 100000 && i <= N; i++)
ans++;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int ans = 0;
for (int i = 1; i < 10 && i <= N; i++)
ans++;
for (int i = 100; i < 1000 && i <= N; i++)
ans++;
for (int i = 10000; i < 100000 && i <= N; i++)
ans++;
cout << ans;
} | [] | 754,820 | 754,821 | u131357627 | cpp |
p02952 | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n - 1; i >= 0; i--)
const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;
int main() {
int n;
int ans = 0;
for (int i = 1; i <= n; i++) {
string is = to_string(i);
if (is.length() % 2 == 1) {
ans++;
}
}
cout << ans << endl;
}
| #include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n - 1; i >= 0; i--)
const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; i++) {
string is = to_string(i);
if (is.length() % 2 == 1) {
ans++;
}
}
cout << ans << endl;
}
| [] | 754,828 | 754,829 | u372177994 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, cnt = 0;
cin >> n;
for (int i = 1; i < n; i++) {
string s = to_string(i);
int len = s.length();
if (len % 2 == 1) {
cnt++;
}
s.clear();
}
cout << cnt;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n, cnt = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
string s = to_string(i);
int len = s.length();
if (len % 2 == 1) {
cnt++;
}
s.clear();
}
cout << cnt;
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 754,831 | 754,832 | u815319946 | cpp |
p02952 | #include <iostream>
using namespace std;
main() {
int n, x = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
int j = i, z = 0;
while (j > 0) {
z++;
j /= 10;
}
if (j & 1)
x++;
}
cout << x;
} | #include <iostream>
using namespace std;
main() {
int n, x = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
int j = i, z = 0;
while (j > 0) {
z++;
j /= 10;
}
if (z & 1)
x++;
}
cout << x;
} | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 754,850 | 754,851 | u228818634 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int ans = 0, ten = 10;
while (N / ten) {
ans += ten * 9 / 10;
ten = ten * 100;
}
ten = ten / 10;
if (N / ten) {
ans = ans - ten + 1;
}
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int ans = 0, ten = 10;
while (N / ten) {
ans += ten * 9 / 10;
ten = ten * 100;
}
ten = ten / 10;
if (N / ten) {
ans += N - ten + 1;
}
cout << ans << endl;
return 0;
}
| [
"assignment.change"
] | 754,860 | 754,861 | u541263126 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define MAX_INT 10e9
int main() {
ll i, j, k, n;
cin >> n;
if (n <= 9) {
cout << n << endl;
return 0;
}
ll sum = 0;
ll ans = 10;
while (ans <= n) {
sum += ans - (ans / 10);
ans = (ans * 100);
}
// cout<<ans<<" "<<sum<<endl;
int dig = 0, m;
m = n;
while (m > 0) {
dig++;
m /= 10;
}
if (dig % 2 == 0)
cout << sum << endl;
else {
dig--;
sum += n - pow(10, dig);
cout << sum << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define MAX_INT 10e9
int main() {
ll i, j, k, n;
cin >> n;
if (n <= 9) {
cout << n << endl;
return 0;
}
ll sum = 0;
ll ans = 10;
while (ans <= n) {
sum += ans - (ans / 10);
ans = (ans * 100);
}
// cout<<ans<<" "<<sum<<endl;
int dig = 0, m;
m = n;
while (m > 0) {
dig++;
m /= 10;
}
if (dig % 2 == 0)
cout << sum << endl;
else {
dig--;
sum += n - pow(10, dig) + 1;
cout << sum << endl;
}
return 0;
}
| [
"assignment.change"
] | 754,875 | 754,876 | u293991054 | cpp |
p02952 | using namespace std;
#include <algorithm>
#include <iostream>
#define ll long long
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
ll mod = 1e9 + 7;
#include <cmath>
int main() {
int n;
cin >> n;
ll ans = 0;
for (int i = 1; i <= n; i++) {
int tmp = log10(i);
if (tmp % 2 == 1)
ans++;
}
cout << ans << endl;
return 0;
} | using namespace std;
#include <algorithm>
#include <iostream>
#define ll long long
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
ll mod = 1e9 + 7;
#include <cmath>
int main() {
int n;
cin >> n;
ll ans = 0;
for (int i = 1; i <= n; i++) {
int tmp = log10(i);
if (tmp % 2 == 0)
ans++;
}
cout << ans << endl;
return 0;
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 754,878 | 754,879 | u981068718 | cpp |
p02952 | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <climits>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> ii;
typedef long long int64;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;
int main() {
int n, ans = 0;
cin >> n;
for (int i = 1; i < n; ++i) {
string str = to_string(i);
ans += str.size() % 2 != 0;
}
cout << ans << endl;
return 0;
}
| #include <algorithm>
#include <assert.h>
#include <bitset>
#include <climits>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> ii;
typedef long long int64;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;
int main() {
int n, ans = 0;
cin >> n;
for (int i = 1; i <= n; ++i) {
string str = to_string(i);
ans += str.size() % 2;
}
cout << ans << endl;
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"expression.operation.binary.remove"
] | 754,884 | 754,885 | u572365590 | cpp |
p02952 | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int odd = 0;
odd = min(n - 9, 9);
odd += min(max(n - 99, 0), 900);
odd += min(max(n - 9999, 0), 90000);
cout << odd << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int odd = 0;
odd = min(n, 9);
odd += min(max(n - 99, 0), 900);
odd += min(max(n - 9999, 0), 90000);
cout << odd << endl;
return 0;
}
| [
"expression.operation.binary.remove"
] | 754,888 | 754,889 | u657667703 | cpp |
p02952 | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int odd = 0;
odd = min(n - 9, 9);
odd += min(max(n - 999, 0), 900);
odd += min(max(n - 9999, 0), 90000);
cout << odd << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int odd = 0;
odd = min(n, 9);
odd += min(max(n - 99, 0), 900);
odd += min(max(n - 9999, 0), 90000);
cout << odd << endl;
return 0;
}
| [
"expression.operation.binary.remove",
"literal.number.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 754,890 | 754,889 | u657667703 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
template <class T> void ckmin(T &a, T b) { a = min(a, b); }
template <class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define repr(i, n) for (int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for (int i = (a); i <= (n); ++i)
#define repst(i, n) for (auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for (int i = (n); i >= (a); --i)
typedef long long ll;
const int inf = int(1e9);
const int mod = 1e9 + 7;
const int N = 1e6 + 555;
const long double PI = acos(-1.0);
void solve() {
int a;
cin >> a;
if (a <= 9)
cout << (a + a % 2) / 2;
else {
int res = 9, cur = 10, cnt = 0;
while (cur <= a) {
if (cnt % 2 == 0 && cnt) {
res *= 100;
res += 9;
}
cur *= 10;
cnt++;
}
cur /= 10;
cout << res + (cnt % 2 == 0) * (a - cur + 1);
}
}
int main() {
Red;
solve();
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
template <class T> void ckmin(T &a, T b) { a = min(a, b); }
template <class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define repr(i, n) for (int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for (int i = (a); i <= (n); ++i)
#define repst(i, n) for (auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for (int i = (n); i >= (a); --i)
typedef long long ll;
const int inf = int(1e9);
const int mod = 1e9 + 7;
const int N = 1e6 + 555;
const long double PI = acos(-1.0);
void solve() {
int a;
cin >> a;
if (a <= 9)
cout << (a);
else {
int res = 9, cur = 10, cnt = 0;
while (cur <= a) {
if (cnt % 2 == 0 && cnt) {
res *= 100;
res += 9;
}
cur *= 10;
cnt++;
}
cur /= 10;
cout << res + (cnt % 2 == 0) * (a - cur + 1);
}
}
int main() {
Red;
solve();
return 0;
}
| [
"expression.operation.binary.remove"
] | 754,905 | 754,906 | u235396011 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int n;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int ans = 0;
cin >> n;
int cur = 1;
while (cur < n) {
ans += min(cur * 9, n - cur + 1);
cur *= 100;
}
cout << ans << '\n';
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int n;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int ans = 0;
cin >> n;
int cur = 1;
while (cur <= n) {
ans += min(cur * 9, n - cur + 1);
cur *= 100;
}
cout << ans << '\n';
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 754,931 | 754,932 | u267710757 | cpp |
p02952 | #include <iostream>
#include <string>
using namespace std;
int main(void) {
long n, count;
count = 0;
cin >> n;
for (long i = 0; i <= n; i++) {
if (to_string(i).length() % 2 == 1) {
count++;
}
}
cout << count;
} | #include <iostream>
#include <string>
using namespace std;
int main(void) {
long n, count;
count = 0;
cin >> n;
for (long i = 1; i <= n; i++) {
if (to_string(i).length() % 2 == 1) {
count++;
}
}
cout << count;
} | [
"literal.number.change",
"variable_declaration.value.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one"
] | 754,933 | 754,934 | u294138643 | cpp |
p02952 | #include <iostream>
using namespace std;
int main(void) {
int N;
cin >> N;
int cnt = 0;
for (int i = 1; i < N; i++) {
if (i < 10) {
cnt++; // 1-9
} else if (i > 99 && i < 1000) {
cnt++; // 100 - 999
} else if (i > 9999 && i < 100000) {
cnt++; // 10000 - 99999
}
}
cout << cnt << endl;
return 0;
} | #include <iostream>
using namespace std;
int main(void) {
int N;
cin >> N;
int cnt = 0;
for (int i = 1; i <= N; i++) {
if (i < 10) {
cnt++; // 1-9
} else if (i > 99 && i < 1000) {
cnt++; // 100 - 999
} else if (i > 9999 && i < 100000) {
cnt++; // 10000 - 99999
}
}
cout << cnt << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 754,939 | 754,940 | u422831867 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, d = 1, ans = 0;
scanf("%d", &n);
for (int i = 1; n >= d; i++) {
d *= 10;
if (i & 1) {
if (n >= d)
ans += d / 10 * 9;
else
ans += n % (d / 10) + 1;
}
}
printf("%d", ans);
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, d = 1, ans = 0;
scanf("%d", &n);
for (int i = 1; n >= d; i++) {
d *= 10;
if (i & 1) {
if (n >= d)
ans += d / 10 * 9;
else
ans += n % d - (d / 10) + 1;
}
}
printf("%d", ans);
return 0;
} | [
"assignment.change"
] | 754,943 | 754,944 | u699826748 | cpp |
p02952 | #include <iostream>
int main() {
int N;
std::cin >> N;
std::cout << std::endl;
int num = 0;
for (int i = 1; i <= N; ++i) {
for (int j = 1; j < N; j *= 100) {
for (int k = 1; k != 10; ++k) {
if (i / j == k) {
num++;
break;
}
}
}
}
std::cout << num << std::endl;
return 0;
} | #include <iostream>
int main() {
int N;
std::cin >> N;
std::cout << std::endl;
int num = 0;
for (int i = 1; i <= N; ++i) {
for (int j = 1; j <= N; j *= 100) {
for (int k = 1; k != 10; ++k) {
if (i / j == k) {
num++;
break;
}
}
}
}
std::cout << num << std::endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 754,949 | 754,950 | u963488157 | cpp |
p02952 | #include <bits/stdc++.h>
#define rep(i, x, n) for (int i = x; i < n; i++)
typedef long long ll;
const int INF = 1e9 + 7;
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
int tmp_n = n;
int odd_scale = 10;
int res = 0;
while (1) {
if ((tmp_n - odd_scale) > 0) {
if (odd_scale == 10)
res += 9;
else
res += (odd_scale - odd_scale / 10) - 1;
odd_scale *= 100;
continue;
}
if (tmp_n - (odd_scale / 10) >= 0) {
res += tmp_n - (odd_scale / 10) + 1;
}
break;
}
cout << res << endl;
return 0;
}
| #include <bits/stdc++.h>
#define rep(i, x, n) for (int i = x; i < n; i++)
typedef long long ll;
const int INF = 1e9 + 7;
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
int tmp_n = n;
int odd_scale = 10;
int res = 0;
while (1) {
if ((tmp_n - odd_scale) >= 0) {
if (odd_scale == 10)
res += 9;
else
res += (odd_scale - odd_scale / 10);
odd_scale *= 100;
continue;
}
if (tmp_n - (odd_scale / 10) >= 0)
res += tmp_n - (odd_scale / 10) + 1;
break;
}
cout << res << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 754,956 | 754,957 | u441723963 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
#define x first
#define y second
#define mp make_pair
#define forn(n) for (int i = 0; i < n; i++)
#define print(n) cout << n << "\n"
#define fprint(n) fout << n << "\n"
/*
ID: argnowillac
TASK:
LANG: C++
*/
int n;
int ans = 0;
int main() {
cin >> n;
for (int i = 1; i < 10 and i < n; i++)
ans++;
for (int i = 100; i < 1000 and i < n; i++)
ans++;
for (int i = 10000; i < 100000 and i < n; i++)
ans++;
cout << ans << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
#define x first
#define y second
#define mp make_pair
#define forn(n) for (int i = 0; i < n; i++)
#define print(n) cout << n << "\n"
#define fprint(n) fout << n << "\n"
/*
ID: argnowillac
TASK:
LANG: C++
*/
int n;
int ans = 0;
int main() {
cin >> n;
for (int i = 1; i < 10 and i <= n; i++)
ans++;
for (int i = 100; i < 1000 and i <= n; i++)
ans++;
for (int i = 10000; i < 100000 and i <= n; i++)
ans++;
cout << ans << endl;
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 754,971 | 754,972 | u948331416 | cpp |
p02952 | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; i++)
#define rrep(i, a, b) for (int i = a; i >= b; i--)
#define fore(i, a) for (auto &i : a)
#define all(x) (x).begin(), (x).end()
//#pragma GCC optimize ("-O3")
using namespace std;
void _main();
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
_main();
}
typedef long long ll;
const int inf = INT_MAX / 2;
const ll infl = 1LL << 60;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
∧_∧
∧_∧ (´<_` ) Welcome to My Coding Space!
( ´_ゝ`) / ⌒i @hamayanhamayan
/ \ | |
/ / ̄ ̄ ̄ ̄/ |
__(__ニつ/ _/ .| .|____
\/____/ (u ⊃
---------------------------------------------------------------------------------------------------*/
int N;
//---------------------------------------------------------------------------------------------------
void _main() {
cin >> N;
int ans = 0;
rep(i, 0, N) {
if (1 <= i and i <= 9)
ans++;
else if (100 <= i and i <= 999)
ans++;
else if (10000 <= i and i <= 99999)
ans++;
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; i++)
#define rrep(i, a, b) for (int i = a; i >= b; i--)
#define fore(i, a) for (auto &i : a)
#define all(x) (x).begin(), (x).end()
//#pragma GCC optimize ("-O3")
using namespace std;
void _main();
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
_main();
}
typedef long long ll;
const int inf = INT_MAX / 2;
const ll infl = 1LL << 60;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
∧_∧
∧_∧ (´<_` ) Welcome to My Coding Space!
( ´_ゝ`) / ⌒i @hamayanhamayan
/ \ | |
/ / ̄ ̄ ̄ ̄/ |
__(__ニつ/ _/ .| .|____
\/____/ (u ⊃
---------------------------------------------------------------------------------------------------*/
int N;
//---------------------------------------------------------------------------------------------------
void _main() {
cin >> N;
int ans = 0;
rep(i, 1, N + 1) {
if (1 <= i and i <= 9)
ans++;
else if (100 <= i and i <= 999)
ans++;
else if (10000 <= i and i <= 99999)
ans++;
}
cout << ans << endl;
}
| [
"literal.number.change",
"call.arguments.change"
] | 754,975 | 754,976 | u141378465 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i < 10 && i <= n; ++i)
++ans;
for (int i = 100; i < 1000 && i <= n; ++i)
++ans;
for (int i = 10000; i <= 100000 && i <= n; ++i)
++ans;
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i < 10 && i <= n; ++i)
++ans;
for (int i = 100; i < 1000 && i <= n; ++i)
++ans;
for (int i = 10000; i < 100000 && i <= n; ++i)
++ans;
cout << ans << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 754,979 | 754,980 | u417207225 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i < 10 && i <= n; ++i)
++ans;
for (int i = 100; i < 1000 && i <= n; ++i)
++ans;
for (int i = 10000; i <= 100000; ++i)
++ans;
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i < 10 && i <= n; ++i)
++ans;
for (int i = 100; i < 1000 && i <= n; ++i)
++ans;
for (int i = 10000; i < 100000 && i <= n; ++i)
++ans;
cout << ans << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 754,981 | 754,980 | u417207225 | cpp |
p02952 | //#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
#define Ms(s, n) memset(s, n, sizeof(s))
#define Rp(i, l, m) for (int i = l; i < m; ++i)
#define Rpd(i, l, m) for (int i = l; i >= m; --i)
#define Rpp(i, l, m) for (int i = l; i <= m; i++)
#define RpAll(it, a) \
for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define All(a) (a).begin(), (a).end()
#define Fi first
#define Se second
#define Pb push_back
#define Pf push_front
#define Is insert
#define Sz(a) int((a).size())
#define ooi INT_MAX
#define ool LLONG_MAX
typedef long long ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
const int MOD = (int)1e9 + 7;
const ld PI = acos((ld)-1);
inline ll gcd(ll a, ll b) {
ll r;
while (b) {
r = a % b;
a = b;
b = r;
}
return a;
}
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
inline ll fpow(ll n, ll k) {
ll r = 1;
for (; k; k >>= 1) {
if (k & 1)
r = r * n % MOD;
n = n * n % MOD;
}
return r;
}
const int base = 311;
const int N = 2e5 + 5;
ll n, m, k, test, a[N], F[N][3];
void Solve() {
cin >> n;
int ans = 0;
for (int i = 1; i < n; i++) {
if (int(log10(i) + 1) & 1)
ans++;
}
cout << ans;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
Solve();
return 0;
}
| //#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
#define Ms(s, n) memset(s, n, sizeof(s))
#define Rp(i, l, m) for (int i = l; i < m; ++i)
#define Rpd(i, l, m) for (int i = l; i >= m; --i)
#define Rpp(i, l, m) for (int i = l; i <= m; i++)
#define RpAll(it, a) \
for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define All(a) (a).begin(), (a).end()
#define Fi first
#define Se second
#define Pb push_back
#define Pf push_front
#define Is insert
#define Sz(a) int((a).size())
#define ooi INT_MAX
#define ool LLONG_MAX
typedef long long ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
const int MOD = (int)1e9 + 7;
const ld PI = acos((ld)-1);
inline ll gcd(ll a, ll b) {
ll r;
while (b) {
r = a % b;
a = b;
b = r;
}
return a;
}
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
inline ll fpow(ll n, ll k) {
ll r = 1;
for (; k; k >>= 1) {
if (k & 1)
r = r * n % MOD;
n = n * n % MOD;
}
return r;
}
const int base = 311;
const int N = 2e5 + 5;
ll n, m, k, test, a[N], F[N][3];
void Solve() {
cin >> n;
int ans = 0;
for (int i = 1; i <= n; i++) {
if (int(log10(i) + 1) & 1)
ans++;
}
cout << ans;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
Solve();
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 754,988 | 754,989 | u671291651 | cpp |
p02952 | #include <cmath>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int count = 0;
for (size_t i = 1; i <= n; i++) {
if ((int)log10(n) % 2 == 0)
count++;
}
cout << count;
} | #include <cmath>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int count = 0;
for (size_t i = 1; i <= n; i++) {
if (((int)log10(i)) % 2 == 0)
count++;
}
cout << count;
} | [
"control_flow.branch.if.condition.change",
"identifier.change"
] | 755,000 | 755,001 | u533749093 | cpp |
p02952 | #include <cmath>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int count = 0;
for (size_t i = 0; i < n; i++) {
if ((int)log10(n) % 2 == 0)
count++;
}
cout << count;
} | #include <cmath>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int count = 0;
for (size_t i = 1; i <= n; i++) {
if (((int)log10(i)) % 2 == 0)
count++;
}
cout << count;
} | [
"literal.number.change",
"variable_declaration.value.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change",
"identifier.change"
] | 755,002 | 755,001 | u533749093 | cpp |
p02952 | #include <iostream>
using namespace std;
int main(void) {
int N;
cin >> N;
int res = 0;
int now = 10;
while (now <= N) {
res += (now - 1) - (now / 10) + 1;
now *= 100;
}
now /= 10;
if (N > now) {
res += N - now + 1;
}
cout << res << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main(void) {
int N;
cin >> N;
int res = 0;
int now = 10;
while (now <= N) {
res += (now - 1) - (now / 10) + 1;
now *= 100;
}
now /= 10;
if (N >= now) {
res += N - now + 1;
}
cout << res << endl;
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 755,019 | 755,020 | u979452668 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, ans = 0;
cin >> N;
for (int i = 1; i < N; i++) {
int l = to_string(i).length();
if (l % 2 == 1)
++ans;
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, ans = 0;
cin >> N;
for (int i = 1; i <= N; i++) {
int l = to_string(i).length();
if (l % 2 == 1)
++ans;
}
cout << ans << endl;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 755,021 | 755,022 | u142253890 | cpp |
p02952 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long int ll;
int main() {
int N;
cin >> N;
int ans = 0;
for (int i = 1; i < N + 1; ++i) {
string s = to_string(N);
if (s.size() % 2 == 1)
++ans;
}
cout << ans << endl;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long int ll;
int main() {
int N;
cin >> N;
int ans = 0;
for (int i = 1; i < N + 1; ++i) {
string s = to_string(i);
if (s.size() % 2 == 1)
++ans;
}
cout << ans << endl;
}
| [
"identifier.change",
"call.arguments.change"
] | 755,029 | 755,030 | u102131583 | cpp |
p02952 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
bool f(int x) {
int digit = 0;
while (x) {
digit++;
x /= 10;
}
return digit % 2 == 1;
}
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i < n; ++i) {
if (f(i))
ans++;
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
bool f(int x) {
int digit = 0;
while (x) {
digit++;
x /= 10;
}
return digit % 2 == 1;
}
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; ++i) {
if (f(i))
ans++;
}
cout << ans << endl;
}
| [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 755,031 | 755,032 | u006721330 | cpp |
p02952 | #include <algorithm>
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;
long long const MOD = 1000000007LL;
int main() {
int n;
cin >> n;
int number = n;
int keta = 0;
while (number > 0) {
++keta;
number /= 10;
}
int res = 0;
if (keta == 1) {
res += keta;
}
if (keta >= 2) {
res += 9;
}
if (keta == 3) {
res += n - 99;
}
if (keta >= 4) {
res += 999 - 99;
}
if (keta == 5) {
res += n - 9999;
}
if (keta == 6) {
res += 99999 - 9999;
}
cout << res << endl;
}
| #include <algorithm>
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;
long long const MOD = 1000000007LL;
int main() {
int n;
cin >> n;
int number = n;
int keta = 0;
while (number > 0) {
++keta;
number /= 10;
}
int res = 0;
if (keta == 1) {
res += n;
}
if (keta >= 2) {
res += 9;
}
if (keta == 3) {
res += n - 99;
}
if (keta >= 4) {
res += 999 - 99;
}
if (keta == 5) {
res += n - 9999;
}
if (keta == 6) {
res += 99999 - 9999;
}
cout << res << endl;
}
| [
"assignment.value.change",
"identifier.change"
] | 755,033 | 755,034 | u427681070 | cpp |
p02952 | #include <algorithm>
#include <cmath>
#include <cstring>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
#define roop(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ull mod = 1e9 + 7;
constexpr int N = 13;
ull dp[100010][N];
int myPower(int a, int n) { // aのn乗の計算
int x = 1;
while (n > 0) { // 全てのbitが捨てられるまで
if (n & 1) { // 一番右のbitが1のとき
x *= a;
}
a *= a;
n >>= 1; // bit全体を右に1つシフトして一番右を捨てる
}
return x;
}
int main() {
int n;
cin >> n;
int ans[3];
ans[0] = 9;
ans[1] = 900;
ans[2] = 90000;
int count = 0;
if (n < 10) {
cout << count << endl;
} else if (n < 100) {
cout << ans[0] << endl;
} else if (n < 1000) {
cout << (ans[0] + (n + 1) - 100) << endl;
} else if (n < 10000) {
cout << (ans[0] + ans[1]) << endl;
} else if (n < 100000) {
cout << (ans[0] + ans[1] + (n + 1) - 10000) << endl;
} else if (n < 1000000) {
cout << (ans[0] + ans[1] + ans[2]) << endl;
}
return 0;
} | #include <algorithm>
#include <cmath>
#include <cstring>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
#define roop(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ull mod = 1e9 + 7;
constexpr int N = 13;
ull dp[100010][N];
int myPower(int a, int n) { // aのn乗の計算
int x = 1;
while (n > 0) { // 全てのbitが捨てられるまで
if (n & 1) { // 一番右のbitが1のとき
x *= a;
}
a *= a;
n >>= 1; // bit全体を右に1つシフトして一番右を捨てる
}
return x;
}
int main() {
int n;
cin >> n;
int ans[3];
ans[0] = 9;
ans[1] = 900;
ans[2] = 90000;
int count = 0;
if (n < 10) {
cout << n << endl;
} else if (n < 100) {
cout << ans[0] << endl;
} else if (n < 1000) {
cout << (ans[0] + (n + 1) - 100) << endl;
} else if (n < 10000) {
cout << (ans[0] + ans[1]) << endl;
} else if (n < 100000) {
cout << (ans[0] + ans[1] + (n + 1) - 10000) << endl;
} else if (n < 1000000) {
cout << (ans[0] + ans[1] + ans[2]) << endl;
}
return 0;
} | [
"identifier.change",
"io.output.change"
] | 755,102 | 755,103 | u924003610 | cpp |
p02952 | #include <iostream>
int main() {
int N;
std::cin >> N;
uint32_t res = 0;
for (int i = 1; i < N; ++i) {
if (i < 10) {
++res;
} else if (i > 99 && i < 1000) {
++res;
} else if (i > 9999 && i < 100000) {
++res;
}
}
std::cout << res << std::endl;
return 0;
} | #include <iostream>
int main() {
int N;
std::cin >> N;
uint32_t res = 0;
for (int i = 1; i <= N; ++i) {
if (i < 10) {
++res;
} else if (i > 99 && i < 1000) {
++res;
} else if (i > 9999 && i < 100000) {
++res;
}
}
std::cout << res << std::endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 755,108 | 755,109 | u526971181 | cpp |
p02952 | #include <iostream>
int main() {
int N;
std::cin >> N;
uint32_t res = 0;
for (int i = 0; i < N; ++i) {
if (i < 10) {
++res;
} else if (i > 99 && i < 1000) {
++res;
} else if (i > 9999 && i < 100000) {
++res;
}
}
std::cout << res << std::endl;
return 0;
} | #include <iostream>
int main() {
int N;
std::cin >> N;
uint32_t res = 0;
for (int i = 1; i <= N; ++i) {
if (i < 10) {
++res;
} else if (i > 99 && i < 1000) {
++res;
} else if (i > 9999 && i < 100000) {
++res;
}
}
std::cout << res << std::endl;
return 0;
} | [
"literal.number.change",
"variable_declaration.value.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 755,110 | 755,109 | u526971181 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
if (N < 10) {
cout << N << endl;
}
if (100 > N) {
if (N >= 10)
cout << 9 << endl;
}
if (1000 > N) {
if (N > 100)
cout << N - 99 + 9 << endl;
}
if (N <= 10000) {
if (N > 1000)
cout << 901 + 9 << endl;
}
if (N > 10000) {
if (N < 100000)
cout << N - 9999 + 909 << endl;
}
if (N >= 100000) {
if (N < 1000000)
cout << 90909 << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
if (N < 10) {
cout << N << endl;
}
if (100 > N) {
if (N >= 10)
cout << 9 << endl;
}
if (1000 > N) {
if (N >= 100)
cout << N - 99 + 9 << endl;
}
if (N < 10000) {
if (N >= 1000)
cout << 900 + 9 << endl;
}
if (N >= 10000) {
if (N < 100000)
cout << N - 9999 + 909 << endl;
}
if (N >= 100000) {
if (N < 1000000)
cout << 90909 << endl;
}
} | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"literal.number.change",
"io.output.change"
] | 755,137 | 755,136 | u372512262 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define all(a) a.begin(), a.end()
template <typename T1, typename T2> inline void chkmax(T1 &x, const T2 &y) {
if (y > x)
x = y;
}
template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 &y) {
if (y < x)
x = y;
}
int check(int a) {
int ans = 0;
while (a) {
ans++;
a /= 2;
}
return ans % 2;
}
void read() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; i++) {
ans += check(i);
}
cout << ans << endl;
}
void run() {}
void write() {}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
read();
run();
write();
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define all(a) a.begin(), a.end()
template <typename T1, typename T2> inline void chkmax(T1 &x, const T2 &y) {
if (y > x)
x = y;
}
template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 &y) {
if (y < x)
x = y;
}
int check(int a) {
int ans = 0;
while (a) {
ans++;
a /= 10;
}
return ans % 2;
}
void read() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; i++) {
ans += check(i);
}
cout << ans << endl;
}
void run() {}
void write() {}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
read();
run();
write();
return 0;
} | [
"literal.number.change",
"assignment.value.change"
] | 755,138 | 755,139 | u194597852 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define all(a) a.begin(), a.end()
template <typename T1, typename T2> inline void chkmax(T1 &x, const T2 &y) {
if (y > x)
x = y;
}
template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 &y) {
if (y < x)
x = y;
}
int check(int a) {
int ans = 0;
while (a) {
ans++;
a /= 2;
}
return ans % 2;
}
void read() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i < n; i++) {
ans += check(i);
}
cout << ans << endl;
}
void run() {}
void write() {}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
read();
run();
write();
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define all(a) a.begin(), a.end()
template <typename T1, typename T2> inline void chkmax(T1 &x, const T2 &y) {
if (y > x)
x = y;
}
template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 &y) {
if (y < x)
x = y;
}
int check(int a) {
int ans = 0;
while (a) {
ans++;
a /= 10;
}
return ans % 2;
}
void read() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; i++) {
ans += check(i);
}
cout << ans << endl;
}
void run() {}
void write() {}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
read();
run();
write();
return 0;
} | [
"literal.number.change",
"assignment.value.change",
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 755,140 | 755,139 | u194597852 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(NULL); \
cout.tie(NULL)
#define ll long long
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define xx first
#define yy second
#define mp make_pair
#define pll pair<ll, ll>
#define mll map<ll, ll>
#define vll vector<ll>
#define pdd pair<double, double>
#define ALL(v) (v).begin(), (v).end()
const ll MOD = 1e9 + 7;
const ll inf = 1e10;
#define MODSET(d) \
if ((d) >= MOD) \
d %= MOD;
#define MODNEGSET(d) \
if ((d) < 0) \
d = ((d % MOD) + MOD) % MOD;
ll power(ll a, ll n) {
ll ans = 1;
while (n) {
if (n & 1)
ans = (ans * a);
n >>= 1;
a = (a * a);
}
return ans;
}
ll powerMod(ll a, ll n) {
ll ans = 1;
while (n) {
if (n & 1)
ans = (ans * a) % MOD;
n >>= 1;
a = (a * a) % MOD;
}
return ans;
}
ll powerMod1(ll a, ll n, ll mod) {
ll ans = 1;
while (n) {
if (n & 1)
ans = (ans * a) % mod;
n >>= 1;
a = (a * a) % mod;
}
return ans;
}
ll lcm(ll a, ll b) { return a * (b / __gcd(a, b)); }
ll sumdigit(ll n) {
ll sum = 0;
while (n) {
sum++;
n = n / 10;
}
return sum;
}
ll countSetBit(ll a) { return __builtin_popcount(a); }
ll length(ll a) {
ll ans = 0;
while (a) {
ans++;
a = a / 10;
}
return ans;
}
// const long sz=1e6+10;
int main() {
fast;
ll t;
// cin>>t;
t = 1;
while (t--) {
ll n;
cin >> n;
ll ans = 0;
for (int i = 1; i < n; i++) {
if (sumdigit(i) & 1)
ans++;
}
cout << ans;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(NULL); \
cout.tie(NULL)
#define ll long long
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define xx first
#define yy second
#define mp make_pair
#define pll pair<ll, ll>
#define mll map<ll, ll>
#define vll vector<ll>
#define pdd pair<double, double>
#define ALL(v) (v).begin(), (v).end()
const ll MOD = 1e9 + 7;
const ll inf = 1e10;
#define MODSET(d) \
if ((d) >= MOD) \
d %= MOD;
#define MODNEGSET(d) \
if ((d) < 0) \
d = ((d % MOD) + MOD) % MOD;
ll power(ll a, ll n) {
ll ans = 1;
while (n) {
if (n & 1)
ans = (ans * a);
n >>= 1;
a = (a * a);
}
return ans;
}
ll powerMod(ll a, ll n) {
ll ans = 1;
while (n) {
if (n & 1)
ans = (ans * a) % MOD;
n >>= 1;
a = (a * a) % MOD;
}
return ans;
}
ll powerMod1(ll a, ll n, ll mod) {
ll ans = 1;
while (n) {
if (n & 1)
ans = (ans * a) % mod;
n >>= 1;
a = (a * a) % mod;
}
return ans;
}
ll lcm(ll a, ll b) { return a * (b / __gcd(a, b)); }
ll sumdigit(ll n) {
ll sum = 0;
while (n) {
sum++;
n = n / 10;
}
return sum;
}
ll countSetBit(ll a) { return __builtin_popcount(a); }
ll length(ll a) {
ll ans = 0;
while (a) {
ans++;
a = a / 10;
}
return ans;
}
// const long sz=1e6+10;
int main() {
fast;
ll t;
// cin>>t;
t = 1;
while (t--) {
ll n;
cin >> n;
ll ans = 0;
for (int i = 1; i <= n; i++) {
if (sumdigit(i) & 1)
ans++;
}
cout << ans;
}
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 755,158 | 755,159 | u630231163 | cpp |
p02952 | #include <iostream>
using namespace std;
int main() {
int n;
int ans = 0;
for (int i = 1; i <= n; i++) {
if (i < 10) {
ans += 1;
} else if (99 < i && i < 1000) {
ans += 1;
} else if (9999 < i && i < 100000) {
ans += 1;
}
}
cout << ans << '\n';
return 0;
} | #include <iostream>
using namespace std;
int main() {
int n;
int ans = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i < 10) {
ans += 1;
} else if (99 < i && i < 1000) {
ans += 1;
} else if (9999 < i && i < 100000) {
ans += 1;
}
}
cout << ans << '\n';
return 0;
} | [] | 755,160 | 755,161 | u589810630 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(a) (a).begin(), (a).end()
#define ll long long
int main() {
int N;
cin >> N;
int M, cnt = 0;
M = N;
while (M) {
cnt++;
M /= 10;
}
int ans = 0;
rep(i, cnt) if (i % 2) ans = ans * 100 + 9;
int X = 1;
rep(i, cnt - 1) X *= 10;
if (cnt % 2)
ans += N % X + 1;
if (N < 10)
ans = N;
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(a) (a).begin(), (a).end()
#define ll long long
int main() {
int N;
cin >> N;
int M, cnt = 0;
M = N;
while (M) {
cnt++;
M /= 10;
}
int ans = 0;
rep(i, cnt) if (i % 2) ans = ans * 100 + 9;
int X = 1;
rep(i, cnt - 1) X *= 10;
if (cnt % 2)
ans += N - X + 1;
if (N < 10)
ans = N;
cout << ans << endl;
} | [
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 755,191 | 755,192 | u154756110 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(), (a).end()
typedef long long ll;
ll mod = 1000000007;
int main() {
int n;
cin >> n;
int tmp = n;
int digit = 0;
while (tmp > 0) {
++digit;
tmp /= 10;
}
int cnt = 0;
for (int i = digit; i > 0; --i) {
if (i % 2 == 0)
continue;
if (i == 1) {
cnt += min(n - 1, 9);
} else if (i == digit) {
cnt += n % (int)pow(10, i - 1) + 1;
} else {
cnt += 9 * (int)pow(10, i - 1);
}
}
cout << cnt << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(), (a).end()
typedef long long ll;
ll mod = 1000000007;
int main() {
int n;
cin >> n;
int tmp = n;
int digit = 0;
while (tmp > 0) {
++digit;
tmp /= 10;
}
int cnt = 0;
for (int i = digit; i > 0; --i) {
if (i % 2 == 0)
continue;
if (i == 1) {
cnt += min(n, 9);
} else if (i == digit) {
cnt += n - (int)pow(10, i - 1) + 1;
} else {
cnt += 9 * (int)pow(10, i - 1);
}
}
cout << cnt << endl;
return 0;
}
| [
"expression.operation.binary.remove",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 755,195 | 755,196 | u960687982 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(), (a).end()
typedef long long ll;
ll mod = 1000000007;
int main() {
int n;
cin >> n;
int tmp = n;
int digit = 0;
while (tmp > 0) {
++digit;
tmp /= 10;
}
int cnt = 0;
for (int i = digit; i > 0; --i) {
if (i % 2 == 0)
continue;
if (i == 1) {
cnt += min(n, 9);
} else if (i == digit) {
cnt += n % (int)pow(10, i - 1) + 1;
} else {
cnt += 9 * (int)pow(10, i - 1);
}
}
cout << cnt << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(), (a).end()
typedef long long ll;
ll mod = 1000000007;
int main() {
int n;
cin >> n;
int tmp = n;
int digit = 0;
while (tmp > 0) {
++digit;
tmp /= 10;
}
int cnt = 0;
for (int i = digit; i > 0; --i) {
if (i % 2 == 0)
continue;
if (i == 1) {
cnt += min(n, 9);
} else if (i == digit) {
cnt += n - (int)pow(10, i - 1) + 1;
} else {
cnt += 9 * (int)pow(10, i - 1);
}
}
cout << cnt << endl;
return 0;
}
| [
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 755,197 | 755,196 | u960687982 | cpp |
p02952 | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int n;
int ans = 0;
cin >> n;
if (n >= 10)
ans += 9;
else
ans += n;
if (n > 99)
ans += n > 999 ? 899 : n - 99;
if (n > 9999)
ans += n > 99999 ? 89999 : n - 9999;
cout << ans << endl;
return 0;
} | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int n;
int ans = 0;
cin >> n;
if (n >= 10)
ans += 9;
else
ans += n;
if (n > 99)
ans += n > 999 ? 900 : n - 99;
if (n > 9999)
ans += n > 99999 ? 90000 : n - 9999;
cout << ans << endl;
return 0;
}
| [
"literal.number.change"
] | 755,202 | 755,203 | u451010951 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int c = 0;
for (int i = 1; i <= N; i *= 100) {
if (i * 10 <= N)
c += i * 9;
else if (N / i > 1)
c += (N / i - 1) * (i - 1) + (N - (N / i) * i + 1);
else
c += N - (N / i) * i + 1;
}
cout << c << "\n";
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int c = 0;
for (int i = 1; i <= N; i *= 100) {
if (i * 10 <= N)
c += i * 9;
else if (N / i > 1)
c += (N / i - 1) * i + (N - (N / i) * i + 1);
else
c += N - (N / i) * i + 1;
}
cout << c << "\n";
} | [] | 755,224 | 755,225 | u602544363 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int c = 0;
for (int i = 1; i <= N; i *= 100) {
if (i * 10 <= N)
c += i * 9;
else if (N / i > 1)
c += (N / i - 1) * (i * 9) + (N - (N / i) * i + 1);
else
c += N - (N / i) * i + 1;
}
cout << c << "\n";
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int c = 0;
for (int i = 1; i <= N; i *= 100) {
if (i * 10 <= N)
c += i * 9;
else if (N / i > 1)
c += (N / i - 1) * i + (N - (N / i) * i + 1);
else
c += N - (N / i) * i + 1;
}
cout << c << "\n";
} | [] | 755,226 | 755,225 | u602544363 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int c = 0;
for (int i = 1; i < N; i *= 100) {
if (i * 10 <= N)
c += i * 9;
else if (N / i > 1)
c += (N / i - 1) * (i * 9) + (N - (N / i) * i + 1);
else
c += N - (N / i) * i + 1;
}
cout << c << "\n";
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int c = 0;
for (int i = 1; i <= N; i *= 100) {
if (i * 10 <= N)
c += i * 9;
else if (N / i > 1)
c += (N / i - 1) * i + (N - (N / i) * i + 1);
else
c += N - (N / i) * i + 1;
}
cout << c << "\n";
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 755,227 | 755,225 | u602544363 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int counter = 0;
int k = 1;
while (pow(10, k) <= N) {
if (k == 1)
counter += 9;
else if (k % 2 == 1) {
counter += (pow(10, k) - 1 - pow(10, (k - 1)));
}
k++;
}
k--;
if (k % 2 == 0)
counter += (N + 1 - pow(10, k));
cout << counter << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int counter = 0;
int k = 1;
while (pow(10, k) <= N) {
if (k == 1)
counter += 9;
else if (k % 2 == 1) {
counter += (pow(10, k) - pow(10, (k - 1)));
}
k++;
}
k--;
if (k % 2 == 0)
counter += (N + 1 - pow(10, k));
cout << counter << endl;
}
| [
"expression.operation.binary.remove"
] | 755,228 | 755,229 | u700981792 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int counter = 0;
int k = 1;
while (pow(10, k) < N) {
if (k == 1)
counter += 9;
else if (k % 2 == 1) {
counter += (pow(10, k) - 1 - pow(10, (k - 1)));
}
k++;
}
k--;
if (k % 2 == 0)
counter += (N + 1 - pow(10, k));
cout << counter << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int counter = 0;
int k = 1;
while (pow(10, k) <= N) {
if (k == 1)
counter += 9;
else if (k % 2 == 1) {
counter += (pow(10, k) - pow(10, (k - 1)));
}
k++;
}
k--;
if (k % 2 == 0)
counter += (N + 1 - pow(10, k));
cout << counter << endl;
}
| [
"expression.operator.compare.change",
"control_flow.loop.condition.change",
"expression.operation.binary.remove"
] | 755,230 | 755,229 | u700981792 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int s = 0;
if (N / 100000 > 0)
s = 90909;
else if (N / 10000 > 0)
s = N - 9999 + 909;
else if (N / 1000 > 0)
s = 909;
else if (N / 100 > 0)
s = N - 99 + 9;
else if (N / 10 > 0)
s = 9;
else if (N > 1)
s = N - 1;
else
s = 0;
cout << s;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int s = 0;
if (N / 100000 > 0)
s = 90909;
else if (N / 10000 > 0)
s = N - 9999 + 909;
else if (N / 1000 > 0)
s = 909;
else if (N / 100 > 0)
s = N - 99 + 9;
else if (N / 10 > 0)
s = 9;
else if (N > 0)
s = N;
else
s = 0;
cout << s;
return 0;
}
| [
"literal.number.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 755,240 | 755,241 | u272916418 | cpp |
p02952 | #include <algorithm>
#include <functional>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <vector>
using namespace std;
#define rep(i, a, b) for (int i = a; i < b; i++)
typedef long long ll;
int s = 0;
int main() {
int N;
int num = 0;
int t = 0;
int ans = 0;
cin >> N;
s += N;
while (N != 0) {
N /= 10;
num += 1;
}
if (num % 2 == 0) {
t = num / 2;
for (int i = 0; i < t; ++i) {
ans += 9 * pow(10, i);
}
} else {
t = int(num / 2);
for (int i = 0; i < t; ++i) {
ans += 9 * pow(10, i);
}
ans += s - pow(10, num - 1);
}
cout << ans << endl;
return 0;
} | #include <algorithm>
#include <functional>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <vector>
using namespace std;
#define rep(i, a, b) for (int i = a; i < b; i++)
typedef long long ll;
int s = 0;
int main() {
int N;
int num = 0;
int t = 0;
int ans = 0;
cin >> N;
s += N;
while (N != 0) {
N /= 10;
num += 1;
}
if (num % 2 == 0) {
t = num / 2;
for (int i = 0; i < t; ++i) {
ans += 9 * pow(10, i * 2);
}
} else {
t = int(num / 2);
for (int i = 0; i < t; ++i) {
ans += 9 * pow(10, i * 2);
}
ans += s - pow(10, num - 1) + 1;
}
cout << ans << endl;
return 0;
} | [
"assignment.change"
] | 755,263 | 755,264 | u061898182 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n;
cin >> n;
ll i = 0;
ll a = n, b = n;
while (1) {
a = a / 10;
b = n % 10;
i++;
if (a == 0)
break;
}
ll tem = 1, ans = 0;
for (ll j = 0; j < i - 1; j++) {
if (j % 2 == 0) {
ans += 9 * tem;
}
tem *= 10;
}
if (i % 2 == 1) {
ans += n % tem;
ans++;
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n;
cin >> n;
ll i = 0;
ll a = n, b = n;
while (1) {
a = a / 10;
b = n % 10;
i++;
if (a == 0)
break;
}
ll tem = 1, ans = 0;
for (ll j = 0; j < i - 1; j++) {
if (j % 2 == 0) {
ans += 9 * tem;
}
tem *= 10;
}
if (i % 2 == 1) {
ans += n - tem;
ans++;
}
cout << ans << endl;
} | [
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 755,311 | 755,312 | u330689597 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n - n % 10 == 0) {
cout << n;
} else {
if (n - n % 100 == 0) {
cout << "9";
} else {
if (n - n % 1000 == 0) {
int a = n - 90;
cout << a;
} else {
if (n % 10000 == 0) {
cout << "909";
} else {
if (n % 100000 == 0) {
int b = n - 9090;
cout << b;
} else {
cout << "90909";
}
}
}
}
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n - n % 10 == 0) {
cout << n;
} else {
if (n - n % 100 == 0) {
cout << "9";
} else {
if (n - n % 1000 == 0) {
int a = n - 90;
cout << a;
} else {
if (n - n % 10000 == 0) {
cout << "909";
} else {
if (n - n % 100000 == 0) {
int b = n - 9090;
cout << b;
} else {
cout << "90909";
}
}
}
}
}
return 0;
} | [
"control_flow.branch.if.condition.change"
] | 755,346 | 755,347 | u664761370 | cpp |
p02952 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(a) (a).begin(), (a).end()
int main() {
ll n;
cin >> n;
ll m = n;
int k = 0;
while (m > 0) {
m /= 10;
k++;
}
ll sum = 0;
rep(i, k - 1) {
if ((i + 1) % 2 != 0) {
sum += 9 * pow(10, i);
}
}
if (k % 2 != 0)
sum += n - pow((ll)10, k - 1);
cout << sum;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(a) (a).begin(), (a).end()
int main() {
ll n;
cin >> n;
ll m = n;
int k = 0;
while (m > 0) {
m /= 10;
k++;
}
ll sum = 0;
rep(i, k - 1) {
if ((i + 1) % 2 != 0) {
sum += 9 * pow(10, i);
}
}
if (k % 2 != 0)
sum += n - pow((ll)10, k - 1) + 1;
cout << sum;
} | [
"assignment.change"
] | 755,348 | 755,349 | u969116807 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define f first
#define s second
#define all(container) container.begin(), container.end()
#define fast \
ios::sync_with_stdio(0); \
cin.tie(0)
#define print(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void __f(const char *name, Arg1 &&arg1) {
cout << name << ": " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
const char *comma = strchr(names + 1, ',');
cout.write(names, comma - names) << " : " << arg1 << " | ";
__f(comma + 1, args...);
}
int32_t main() {
fast;
int n;
cin >> n;
int len = to_string(n).size();
int ans = 0;
int i;
for (i = 1; i <= len - 1; i += 2) {
ans = ans + (9 * pow(10, i - 1));
}
int k = n - pow(10, i - 1);
if (k > 0) {
ans = ans + k + 1;
}
cout << ans << '\n';
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define f first
#define s second
#define all(container) container.begin(), container.end()
#define fast \
ios::sync_with_stdio(0); \
cin.tie(0)
#define print(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void __f(const char *name, Arg1 &&arg1) {
cout << name << ": " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
const char *comma = strchr(names + 1, ',');
cout.write(names, comma - names) << " : " << arg1 << " | ";
__f(comma + 1, args...);
}
int32_t main() {
fast;
int n;
cin >> n;
int len = to_string(n).size();
int ans = 0;
int i;
for (i = 1; i <= len - 1; i += 2) {
ans = ans + (9 * pow(10, i - 1));
}
int k = n - pow(10, i - 1);
if (k >= 0) {
ans = ans + k + 1;
}
cout << ans << '\n';
return 0;
} | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 755,350 | 755,351 | u153896700 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define f first
#define s second
#define all(container) container.begin(), container.end()
#define fast \
ios::sync_with_stdio(0); \
cin.tie(0)
#define print(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void __f(const char *name, Arg1 &&arg1) {
cout << name << ": " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
const char *comma = strchr(names + 1, ',');
cout.write(names, comma - names) << " : " << arg1 << " | ";
__f(comma + 1, args...);
}
int32_t main() {
fast;
int n;
cin >> n;
int len = to_string(n).size();
int ans = 0;
int i;
for (i = 1; i <= len - 1; i += 2) {
ans = ans + (9 * pow(10, i));
}
int k = n - pow(10, i - 1);
if (k > 0) {
ans = ans + k + 1;
}
cout << ans << '\n';
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define f first
#define s second
#define all(container) container.begin(), container.end()
#define fast \
ios::sync_with_stdio(0); \
cin.tie(0)
#define print(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void __f(const char *name, Arg1 &&arg1) {
cout << name << ": " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
const char *comma = strchr(names + 1, ',');
cout.write(names, comma - names) << " : " << arg1 << " | ";
__f(comma + 1, args...);
}
int32_t main() {
fast;
int n;
cin >> n;
int len = to_string(n).size();
int ans = 0;
int i;
for (i = 1; i <= len - 1; i += 2) {
ans = ans + (9 * pow(10, i - 1));
}
int k = n - pow(10, i - 1);
if (k >= 0) {
ans = ans + k + 1;
}
cout << ans << '\n';
return 0;
} | [
"assignment.change",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 755,352 | 755,351 | u153896700 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define fastio() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define test() \
ull t; \
cin >> t; \
while (t--)
#define pb push_back
#define mkp make_pair
#define nl cout << endl
#define MOD 1000000007
#define loop(i, start, end) for (int i = start; i < end; i++)
#define N 100001
#define oa(a, n) \
for (int i = 0; i < n; i++) \
cout << a[i] << " "; \
nl;
#define ov(a) \
for (int i = 0; i < a.size(); i++) \
cout << a[i] << endl;
#define pi M_PI
int main() {
fastio();
int n;
cin >> n;
if (n < 10) {
cout << n - 1;
} else if (n < 100) {
cout << 9;
} else if (n < 1000) {
cout << 9 + (n - 100);
} else if (n < 10000) {
cout << 909;
} else if (n < 100000) {
cout << 909 + (n - 10000);
} else
cout << 90909;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define fastio() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define test() \
ull t; \
cin >> t; \
while (t--)
#define pb push_back
#define mkp make_pair
#define nl cout << endl
#define MOD 1000000007
#define loop(i, start, end) for (int i = start; i < end; i++)
#define N 100001
#define oa(a, n) \
for (int i = 0; i < n; i++) \
cout << a[i] << " "; \
nl;
#define ov(a) \
for (int i = 0; i < a.size(); i++) \
cout << a[i] << endl;
#define pi M_PI
int main() {
fastio();
int n;
cin >> n;
if (n < 10) {
cout << n;
} else if (n < 100) {
cout << 9;
} else if (n < 1000) {
cout << 10 + (n - 100);
} else if (n < 10000) {
cout << 909;
} else if (n < 100000) {
cout << 910 + (n - 10000);
} else
cout << 90909;
return 0;
} | [
"expression.operation.binary.remove",
"literal.number.change",
"io.output.change"
] | 755,361 | 755,362 | u419301893 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define fastio() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define test() \
ull t; \
cin >> t; \
while (t--)
#define pb push_back
#define mkp make_pair
#define nl cout << endl
#define MOD 1000000007
#define loop(i, start, end) for (int i = start; i < end; i++)
#define N 100001
#define oa(a, n) \
for (int i = 0; i < n; i++) \
cout << a[i] << " "; \
nl;
#define ov(a) \
for (int i = 0; i < a.size(); i++) \
cout << a[i] << endl;
#define pi M_PI
int main() {
fastio();
int n;
cin >> n;
if (n < 10) {
cout << n - 1;
} else if (n < 100) {
cout << 9;
} else if (n < 1000) {
cout << 10 + (n - 100);
} else if (n < 10000) {
cout << 909;
} else if (n < 100000) {
cout << 909 + (n - 10000);
} else
cout << 90909;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define fastio() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define test() \
ull t; \
cin >> t; \
while (t--)
#define pb push_back
#define mkp make_pair
#define nl cout << endl
#define MOD 1000000007
#define loop(i, start, end) for (int i = start; i < end; i++)
#define N 100001
#define oa(a, n) \
for (int i = 0; i < n; i++) \
cout << a[i] << " "; \
nl;
#define ov(a) \
for (int i = 0; i < a.size(); i++) \
cout << a[i] << endl;
#define pi M_PI
int main() {
fastio();
int n;
cin >> n;
if (n < 10) {
cout << n;
} else if (n < 100) {
cout << 9;
} else if (n < 1000) {
cout << 10 + (n - 100);
} else if (n < 10000) {
cout << 909;
} else if (n < 100000) {
cout << 910 + (n - 10000);
} else
cout << 90909;
return 0;
} | [
"expression.operation.binary.remove",
"literal.number.change",
"io.output.change"
] | 755,363 | 755,362 | u419301893 | cpp |
p02952 | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define MOD 1000000007
#define INF 1e9 + 7
#define rep(i, n) for (int i = 0; i < n; ++i)
typedef long long ll;
#define MAX_N 100000
#define MAX_M 100000
#define MAX_V 100
#define MAX_E 100
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
int ddx[] = {-1, 0, 1, 0, -1, 1, -1, 1};
int ddy[] = {0, -1, 0, 1, 1, 1, -1, -1};
//--------------------------
int cnt;
bool func(int x) {
int a = 0;
while (x != 0) {
++a;
x /= 10;
}
if (a % 2 == 1)
return true;
else
return false;
}
int main() {
int n;
cin >> n;
for (int i = 1; i < n; ++i) {
if (func(i))
++cnt;
}
cout << cnt << endl;
return 0;
}
| #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define MOD 1000000007
#define INF 1e9 + 7
#define rep(i, n) for (int i = 0; i < n; ++i)
typedef long long ll;
#define MAX_N 100000
#define MAX_M 100000
#define MAX_V 100
#define MAX_E 100
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
int ddx[] = {-1, 0, 1, 0, -1, 1, -1, 1};
int ddy[] = {0, -1, 0, 1, 1, 1, -1, -1};
//--------------------------
int cnt;
bool func(int x) {
int a = 0;
while (x != 0) {
++a;
x /= 10;
}
if (a % 2 == 1)
return true;
else
return false;
}
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; ++i) {
if (func(i)) {
++cnt;
}
}
cout << cnt << endl;
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 755,370 | 755,371 | u541830414 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, ans = 0;
cin >> n;
string str = to_string(n);
int i = 1;
if (n < 10) {
cout << n;
return 0;
}
while (i * 100 < n) {
ans += i * 9;
i *= 100;
}
if (str.size() % 2 == 1)
ans += n - i + 1;
else
ans += i * 9;
cout << ans;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n, ans = 0;
cin >> n;
string str = to_string(n);
int i = 1;
if (n < 10) {
cout << n;
return 0;
}
while (i * 100 <= n) {
ans += i * 9;
i *= 100;
}
if (str.size() % 2 == 1)
ans += n - i + 1;
else
ans += i * 9;
cout << ans;
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 755,395 | 755,396 | u346051135 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, ans = 0;
cin >> n;
string str = to_string(n);
int i = 1;
if (n < 10)
cout << n;
while (i * 100 < n) {
ans += i * 9;
i *= 100;
}
if (str.size() % 2 == 1)
ans += n - i + 1;
else
ans += i * 9;
cout << ans;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n, ans = 0;
cin >> n;
string str = to_string(n);
int i = 1;
if (n < 10) {
cout << n;
return 0;
}
while (i * 100 <= n) {
ans += i * 9;
i *= 100;
}
if (str.size() % 2 == 1)
ans += n - i + 1;
else
ans += i * 9;
cout << ans;
return 0;
}
| [
"control_flow.return.add",
"control_flow.return.0.add",
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 755,397 | 755,396 | u346051135 | cpp |
p02952 | /*
ID: wangjun30
TASK:
LANG: C++
*/
#include <iostream>
using namespace std;
bool pd(int x) {
int s;
while (x) {
x /= 10;
s++;
}
return s % 2;
}
int main() {
int n, ans = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
if (pd(i))
ans++;
}
cout << ans;
return 0;
} | /*
ID: wangjun30
TASK:
LANG: C++
*/
#include <iostream>
using namespace std;
bool pd(int x) {
int s = 0;
while (x) {
x /= 10;
s++;
}
return s % 2;
}
int main() {
int n, ans = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
if (pd(i))
ans++;
}
cout << ans;
return 0;
} | [
"variable_declaration.value.change"
] | 755,401 | 755,402 | u555933327 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll n, t, c = 0, ans = 0;
cin >> n;
t = n;
while (t > 0) {
t /= 10;
c++;
}
if (c % 2) {
ans += (n - pow(10, c - 1));
c -= 2;
while (c > 0) {
ans += (9 * pow(10, c - 1));
c -= 2;
}
} else {
c--;
while (c > 0) {
ans += (9 * pow(10, c - 1));
c -= 2;
}
}
cout << ans;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll n, t, c = 0, ans = 0;
cin >> n;
t = n;
while (t > 0) {
t /= 10;
c++;
}
if (c % 2) {
ans += (n - pow(10, c - 1));
ans++;
c -= 2;
while (c > 0) {
ans += (9 * pow(10, c - 1));
c -= 2;
}
} else {
c--;
while (c > 0) {
ans += (9 * pow(10, c - 1));
c -= 2;
}
}
cout << ans;
return 0;
} | [
"expression.unary.arithmetic.add"
] | 755,413 | 755,414 | u228402731 | cpp |
p02952 | #include <iostream>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
int max = 1;
for (int i = 10 * 10 * 10 * 10 * 10; i > 1; i /= 10) {
if (n / i > 0) {
max = i;
break;
}
}
int ans;
if (max == 10 * 10 * 10 * 10 * 10) {
ans = 90909;
for (int i = 0; 1; i++) {
if (n < 1000000 + i)
break;
else
ans++;
}
} else if (max == 10 * 10 * 10 * 10 || max == 10 * 10 * 10) {
ans = 909;
for (int i = 0; 1; i++) {
if (n < 10000 + i)
break;
else
ans++;
}
} else if (max == 10 * 10 || max == 10) {
ans = 9;
for (int i = 0; 1; i++) {
if (n < 100 + i)
break;
else
ans++;
}
} else {
ans = 0;
for (int i = 0; 1; i++) {
if (n < i)
break;
else
ans++;
}
}
cout << ans << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
int max = 1;
for (int i = 10 * 10 * 10 * 10 * 10; i > 1; i /= 10) {
if (n / i > 0) {
max = i;
break;
}
}
int ans;
if (max == 10 * 10 * 10 * 10 * 10) {
ans = 90909;
for (int i = 0; 1; i++) {
if (n < 1000000 + i)
break;
else
ans++;
}
} else if (max == 10 * 10 * 10 * 10 || max == 10 * 10 * 10) {
ans = 909;
for (int i = 0; 1; i++) {
if (n < 10000 + i)
break;
else
ans++;
}
} else if (max == 10 * 10 || max == 10) {
ans = 9;
for (int i = 0; 1; i++) {
if (n < 100 + i)
break;
else
ans++;
}
} else {
ans = 0;
for (int i = 1; 1; i++) {
if (n < i)
break;
else
ans++;
}
}
cout << ans << endl;
return 0;
}
| [
"literal.number.change",
"variable_declaration.value.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one"
] | 755,415 | 755,416 | u464190313 | cpp |
p02952 | #include "bits/stdc++.h"
using namespace std;
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i < n; i++) {
if (i < 10) {
ans++;
} else if (i > 99 && i < 1000) {
ans++;
} else if (i > 9999 && i < 100000) {
ans++;
}
}
cout << ans << endl;
return 0;
} | #include "bits/stdc++.h"
using namespace std;
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; i++) {
if (i < 10) {
ans++;
} else if (i > 99 && i < 1000) {
ans++;
} else if (i > 9999 && i < 100000) {
ans++;
}
}
cout << ans << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 755,430 | 755,431 | u297292406 | cpp |
p02952 | #include <iostream>
#include <math.h>
using namespace std;
int main() {
string s;
cin >> s;
int digits = s.size();
int count = digits / 2 * 2 - 1, ret = 0, digitCount = 9;
for (int i = 1; i <= count; i = i + 2) {
ret = ret + digitCount;
digitCount *= 100;
}
if (digits % 2 == 1) {
ret = ret + stoi(s) - pow(10, digits - 1);
}
cout << ret << endl;
return 0;
} | #include <iostream>
#include <math.h>
using namespace std;
int main() {
string s;
cin >> s;
int digits = s.size();
int count = digits / 2 * 2 - 1, ret = 0, digitCount = 9;
for (int i = 1; i <= count; i = i + 2) {
ret = ret + digitCount;
digitCount *= 100;
}
if (digits % 2 == 1) {
ret = ret + (stoi(s) - pow(10, digits - 1) + 1);
}
cout << ret << endl;
return 0;
} | [] | 755,436 | 755,437 | u075766104 | cpp |
p02952 | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <numeric>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const bool DEBAG = false;
ll pow10(int n) {
ll ret = 1;
while (n != 0) {
n--;
ret *= 10;
}
}
int main() {
int n;
cin >> n;
int keta = 0;
int n_tmp = n;
while (n_tmp > 0) {
keta += 1;
n_tmp /= 10;
}
ll ans = 0;
// cout << "keta " << keta << endl;
if (keta % 2 == 1) {
ans += n - pow10(keta - 1) + 1;
keta--;
}
while (keta != 0) {
if (keta % 2 == 1)
ans += 9 * pow10(keta) / 10;
keta--;
}
cout << ans << endl;
} | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <numeric>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const bool DEBAG = false;
ll pow10(int n) {
ll ret = 1;
while (n != 0) {
n--;
ret *= 10;
}
return ret;
}
int main() {
int n;
cin >> n;
int keta = 0;
int n_tmp = n;
while (n_tmp > 0) {
keta += 1;
n_tmp /= 10;
}
ll ans = 0;
// cout << "keta " << keta << endl;
if (keta % 2 == 1) {
ans += n - pow10(keta - 1) + 1;
keta--;
}
while (keta != 0) {
if (keta % 2 == 1)
ans += 9 * pow10(keta) / 10;
keta--;
}
cout << ans << endl;
} | [
"control_flow.return.add"
] | 755,444 | 755,445 | u412550879 | cpp |
p02952 | #include <stdio.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int n, res;
scanf("%d", &n);
if (n > 99999) {
res = 90909;
} else if (n > 10000) {
res = (n - 9999) + 909;
} else if (n > 999) {
res = 909;
} else if (n > 100) {
res = (n - 99) + 9;
} else if (n > 9) {
res = 9;
} else {
res = n;
}
printf("%d\n", res);
return 0;
}
| #include <stdio.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int n, res;
scanf("%d", &n);
if (n > 99999) {
res = 90909;
} else if (n > 9999) {
res = (n - 9999) + 909;
} else if (n > 999) {
res = 909;
} else if (n > 99) {
res = (n - 99) + 9;
} else if (n > 9) {
res = 9;
} else {
res = n;
}
printf("%d\n", res);
return 0;
}
| [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 755,453 | 755,454 | u917198146 | cpp |
p02952 | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
int n;
int c;
c = 0;
scanf("%d", &n);
if (n >= 10) {
c += 9;
} else {
c += n;
return 0;
}
if (n >= 1000) {
c += 900;
} else if (n >= 100) {
c += n - 99;
}
if (n >= 100000) {
c += 90000;
} else if (n >= 10000) {
c += n - 9999;
}
printf("%d\n", c);
return 0;
} | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
int main(void){
int n;
int h[100000];
return 0;
}
*/
int main(void) {
int n;
int c;
c = 0;
scanf("%d", &n);
if (n >= 10) {
c += 9;
} else {
c += n;
}
if (n >= 1000) {
c += 900;
} else if (n >= 100) {
c += n - 99;
}
if (n >= 100000) {
c += 90000;
} else if (n >= 10000) {
c += n - 9999;
}
printf("%d\n", c);
return 0;
} | [] | 755,458 | 755,459 | u966052848 | cpp |
p02952 | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
if (N >= 100000) {
cout << 90909 << endl;
} else if (N >= 10000 && N < 100000) {
cout << N - 10000 + 1 + 909 << endl;
} else if (N >= 1000 && N < 10000) {
cout << 909 << endl;
} else if (N >= 100 && N < 1000) {
cout << N - 100 + 1 + 9 << endl;
} else if (N >= 10 && N < 100) {
cout << 9 << endl;
} else if (N >= 1 && N < 100) {
cout << N + 1 << endl;
} else {
cout << 0 << endl;
}
return 0;
}
| #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
if (N >= 100000) {
cout << 90909 << endl;
} else if (N >= 10000 && N < 100000) {
cout << N - 10000 + 1 + 909 << endl;
} else if (N >= 1000 && N < 10000) {
cout << 909 << endl;
} else if (N >= 100 && N < 1000) {
cout << N - 100 + 1 + 9 << endl;
} else if (N >= 10 && N < 100) {
cout << 9 << endl;
} else if (N >= 0 && N < 10) {
cout << N << endl;
} else {
cout << 0 << endl;
}
return 0;
}
| [
"literal.number.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 755,463 | 755,464 | u791220701 | cpp |
p02952 | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
if (N >= 10000) {
cout << 90909 << endl;
} else if (N >= 10000 && N < 100000) {
cout << N - 10000 + 1 + 909 << endl;
} else if (N >= 1000 && N < 10000) {
cout << 909 << endl;
} else if (N >= 100 && N < 1000) {
cout << N - 100 + 1 + 9 << endl;
} else if (N >= 10 && N < 100) {
cout << 9 << endl;
} else if (N >= 1 && N < 100) {
cout << N + 1 << endl;
} else {
cout << 0 << endl;
}
return 0;
}
| #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
if (N >= 100000) {
cout << 90909 << endl;
} else if (N >= 10000 && N < 100000) {
cout << N - 10000 + 1 + 909 << endl;
} else if (N >= 1000 && N < 10000) {
cout << 909 << endl;
} else if (N >= 100 && N < 1000) {
cout << N - 100 + 1 + 9 << endl;
} else if (N >= 10 && N < 100) {
cout << 9 << endl;
} else if (N >= 0 && N < 10) {
cout << N << endl;
} else {
cout << 0 << endl;
}
return 0;
}
| [
"literal.number.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 755,466 | 755,464 | u791220701 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
#define pb push_back
#define fastIO \
ios_base::sync_with_stdio(false); \
cin.tie(nullptr);
#define endl '\n'
#define deb(x) cout << #x << " " << x << endl;
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; i < n; i++)
struct greaterr {
template <class T> bool operator()(T const &a, T const &b) const {
return a > b;
}
};
vector<bool> sieve(1000007, true);
void help() {
sieve[0] = false;
sieve[1] = false;
for (int i = 2; i * i <= 1000000; ++i) {
if (sieve[i]) {
for (int j = i * i; j <= 1000000; j += i)
sieve[j] = false;
}
}
}
int main() {
fastIO
int n;
cin >> n;
if (n <= 9)
cout << n;
else if (n > 9 && n <= 99)
cout << n;
else if (n >= 100 && n <= 999)
cout << (9 + n - 100 + 1);
else if (n > 999 && n < 9999)
cout << (9 + 999 - 100 + 1);
else if (n >= 10000 && n <= 99999)
cout << (9 + 999 - 100 + 1 + n - 10000 + 1);
else
cout << (9 + 999 - 100 + 1 + 99999 - 10000 + 1);
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
#define pb push_back
#define fastIO \
ios_base::sync_with_stdio(false); \
cin.tie(nullptr);
#define endl '\n'
#define deb(x) cout << #x << " " << x << endl;
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; i < n; i++)
struct greaterr {
template <class T> bool operator()(T const &a, T const &b) const {
return a > b;
}
};
vector<bool> sieve(1000007, true);
void help() {
sieve[0] = false;
sieve[1] = false;
for (int i = 2; i * i <= 1000000; ++i) {
if (sieve[i]) {
for (int j = i * i; j <= 1000000; j += i)
sieve[j] = false;
}
}
}
int main() {
fastIO
int n;
cin >> n;
if (n <= 9)
cout << n;
else if (n > 9 && n <= 99)
cout << "9";
else if (n >= 100 && n <= 999)
cout << (9 + n - 100 + 1);
else if (n > 999 && n < 9999)
cout << (9 + 999 - 100 + 1);
else if (n >= 10000 && n <= 99999)
cout << (9 + 999 - 100 + 1 + n - 10000 + 1);
else
cout << (9 + 999 - 100 + 1 + 99999 - 10000 + 1);
return 0;
}
| [
"io.output.change"
] | 755,467 | 755,468 | u702142173 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int check(int val) {
int cnt = 0;
while (val > 0) {
cnt++;
val = val / 10;
}
if (cnt & 1)
return 1;
return 0;
}
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i < n; i++) {
if (check(i))
ans++;
}
cout << ans;
} | #include <bits/stdc++.h>
using namespace std;
int check(int val) {
int cnt = 0;
while (val > 0) {
cnt++;
val = val / 10;
}
if (cnt & 1)
return 1;
return 0;
}
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; i++) {
if (check(i))
ans++;
}
cout << ans;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 755,482 | 755,483 | u049031340 | cpp |
p02952 |
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
int Nketa = 0;
if (N < 10) {
Nketa = 1;
} else if (N < 100) {
Nketa = 2;
} else if (N < 1000) {
Nketa = 3;
} else if (N < 10000) {
Nketa = 4;
} else if (N < 100000) {
Nketa = 5;
} else if (N < 1000000) {
Nketa = 6;
}
int ans = 0;
if (Nketa == 1) {
ans = Nketa;
}
if (Nketa == 2) {
ans = 9;
}
if (Nketa == 3) {
ans = N - 90;
}
if (Nketa == 4) {
ans = 909;
}
if (Nketa == 5) {
ans = N - 90 - 9000;
}
if (Nketa == 6) {
ans = 90909;
}
cout << ans << endl;
}
| #include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
int Nketa = 0;
if (N < 10) {
Nketa = 1;
} else if (N < 100) {
Nketa = 2;
} else if (N < 1000) {
Nketa = 3;
} else if (N < 10000) {
Nketa = 4;
} else if (N < 100000) {
Nketa = 5;
} else if (N < 1000000) {
Nketa = 6;
}
int ans = 0;
if (Nketa == 1) {
ans = N;
}
if (Nketa == 2) {
ans = 9;
}
if (Nketa == 3) {
ans = N - 90;
}
if (Nketa == 4) {
ans = 909;
}
if (Nketa == 5) {
ans = N - 90 - 9000;
}
if (Nketa == 6) {
ans = 90909;
}
cout << ans << endl;
}
| [
"assignment.value.change",
"identifier.change"
] | 755,500 | 755,501 | u910757347 | cpp |
p02952 | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef long long ll;
typedef vector<ll> vl;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
#define ALL(a) (a).begin(), a.end()
#define MAXE(a) *max_element(ALL(a))
#define MINE(a) *min_element(ALL(a))
int main() {
int N;
cin >> N;
int p = 0;
if (N < 1000000)
p = 9 + 900 + 90000;
if (N < 100000)
p = 9 + 900 + N - 10000 + 1;
if (N < 10000)
p = 9 + 900;
if (N < 1000)
p = 9 + N - 100 + 1;
if (N < 100)
p = 9;
if (N < 10)
p = N + 1;
cout << p << endl;
}
| #include <algorithm>
#include <cstdio>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef long long ll;
typedef vector<ll> vl;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
#define ALL(a) (a).begin(), a.end()
#define MAXE(a) *max_element(ALL(a))
#define MINE(a) *min_element(ALL(a))
int main() {
int N;
cin >> N;
int p = 0;
if (N < 1000000)
p = 9 + 900 + 90000;
if (N < 100000)
p = 9 + 900 + N - 10000 + 1;
if (N < 10000)
p = 9 + 900;
if (N < 1000)
p = 9 + N - 100 + 1;
if (N < 100)
p = 9;
if (N < 10)
p = N;
cout << p << endl;
}
| [
"expression.operation.binary.remove"
] | 755,506 | 755,507 | u960094718 | cpp |
p02952 | #include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD=998244353;
const long long LINF = 1e18;
using namespace std;
#define int long long
#define fin \
{ \
cout << "No" << endl; \
return 0; \
}
// template
// main
signed main() {
int N;
cin >> N;
int ans = 0;
for (int i = 1; i <= N; i++) {
if (i >= 1e4)
ans++;
else if (i >= 1e2 && i < 1e3)
ans++;
else if (i < 10)
ans++;
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD=998244353;
const long long LINF = 1e18;
using namespace std;
#define int long long
#define fin \
{ \
cout << "No" << endl; \
return 0; \
}
// template
// main
signed main() {
int N;
cin >> N;
int ans = 0;
for (int i = 1; i <= N; i++) {
if (i >= 1e4 && i < 1e5)
ans++;
else if (i >= 1e2 && i < 1e3)
ans++;
else if (i < 10)
ans++;
}
cout << ans << endl;
}
| [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 755,508 | 755,509 | u942774736 | cpp |
p02952 | #include <bits/stdc++.h>
#define int long long
using namespace std;
int ans(int n) {
int x = to_string(n).size();
int m = pow(10, x - 1);
if (x == 1)
return n;
else if (x % 2) {
return n - m + 1 + ans(n % m);
} else
return ans(m - 1);
}
signed main() {
int n;
cin >> n;
cout << ans(n) << endl;
} | #include <bits/stdc++.h>
#define int long long
using namespace std;
int ans(int n) {
int x = to_string(n).size();
int m = pow(10, x - 1);
if (x == 1)
return n;
else if (x % 2) {
return n - m + 1 + ans(m - 1);
} else
return ans(m - 1);
}
signed main() {
int n;
cin >> n;
cout << ans(n) << endl;
} | [
"expression.operation.binary.remove"
] | 755,512 | 755,513 | u698760125 | cpp |
p02952 | #include <iomanip>
#include <iostream>
//#include<cstdio>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <map>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
int N;
int main() {
cin >> N;
int k = 1;
ll d = 1;
ll ans = 0;
while (N > d) {
if (k % 2 == 1) {
ans += min(N - d + 1, 9 * d);
}
d *= 10;
k++;
}
cout << ans << endl;
return 0;
}
| #include <iomanip>
#include <iostream>
//#include<cstdio>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <map>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
int N;
int main() {
cin >> N;
int k = 1;
ll d = 1;
ll ans = 0;
while (N >= d) {
if (k % 2 == 1) {
ans += min(N - d + 1, 9 * d);
}
d *= 10;
k++;
}
cout << ans << endl;
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 755,518 | 755,519 | u534998883 | cpp |
p02952 | #include <iostream>
using namespace std;
int solve(int num) {
int re = 0;
while (num) {
re++;
num /= 10;
}
return re;
}
int main() {
int N, ans = 0;
for (int i = 1; i <= N; i++)
if (solve(i) & 1)
ans++;
cout << ans;
return 0;
} | #include <iostream>
using namespace std;
int solve(int num) {
int re = 0;
while (num) {
re++;
num /= 10;
}
return re;
}
int main() {
int N, ans = 0;
cin >> N;
for (int i = 1; i <= N; i++)
if (solve(i) & 1)
ans++;
cout << ans;
return 0;
} | [] | 755,529 | 755,530 | u592284018 | cpp |
p02952 | // Created by liszt on 2019/08/04.
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n < 100) {
cout << min(9, n) << endl;
} else if (n < 10000) {
cout << min(909, n - 90) << endl;
} else {
cout << min(90000, n - 9090) << endl;
}
} | // Created by liszt on 2019/08/04.
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n < 100) {
cout << min(9, n) << endl;
} else if (n < 10000) {
cout << min(909, n - 90) << endl;
} else {
cout << min(90909, n - 9090) << endl;
}
} | [
"literal.number.change",
"io.output.change"
] | 755,545 | 755,546 | u370447425 | cpp |
p02952 | // TOPSIC001_0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef int _loop_int;
#define REP(i, n) for (_loop_int i = 0; i < (_loop_int)(n); ++i)
#define FOR(i, a, b) for (_loop_int i = (_loop_int)(a); i < (_loop_int)(b); ++i)
#define FORR(i, a, b) \
for (_loop_int i = (_loop_int)(b)-1; i >= (_loop_int)(a); --i)
#define DEBUG(x) cout << #x << ": " << x << endl
#define DEBUG_VEC(v) \
cout << #v << ":"; \
REP(i, v.size()) cout << " " << v[i]; \
cout << endl
#define ALL(a) (a).begin(), (a).end()
#define CHMIN(a, b) a = min((a), (b))
#define CHMAX(a, b) a = max((a), (b))
// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a) % MOD + MOD) % MOD
// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x) < EPS)
#define EQ(a, b) (abs(a - b) < EPS)
typedef complex<Real> P;
int main() {
int A;
cin >> A;
int ans = 0;
for (int i = 1; i < A; i++) {
if (to_string(i).size() % 2 != 0) {
ans++;
}
}
cout << ans;
} | // TOPSIC001_0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef int _loop_int;
#define REP(i, n) for (_loop_int i = 0; i < (_loop_int)(n); ++i)
#define FOR(i, a, b) for (_loop_int i = (_loop_int)(a); i < (_loop_int)(b); ++i)
#define FORR(i, a, b) \
for (_loop_int i = (_loop_int)(b)-1; i >= (_loop_int)(a); --i)
#define DEBUG(x) cout << #x << ": " << x << endl
#define DEBUG_VEC(v) \
cout << #v << ":"; \
REP(i, v.size()) cout << " " << v[i]; \
cout << endl
#define ALL(a) (a).begin(), (a).end()
#define CHMIN(a, b) a = min((a), (b))
#define CHMAX(a, b) a = max((a), (b))
// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a) % MOD + MOD) % MOD
// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x) < EPS)
#define EQ(a, b) (abs(a - b) < EPS)
typedef complex<Real> P;
int main() {
int A;
cin >> A;
int ans = 0;
for (int i = 1; i <= A; i++) {
if (to_string(i).size() % 2 != 0) {
ans++;
}
}
cout << ans;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 755,549 | 755,550 | u245710867 | cpp |
p02952 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; ++i) {
if (i == 10 || i == 1000)
i *= 10;
if (i <= n)
++ans;
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; ++i) {
if (i == 10 || i == 1000 || i == 100000)
i *= 10;
if (i <= n)
++ans;
}
cout << ans << endl;
} | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 755,551 | 755,552 | u647474992 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.