problem_id stringlengths 6 6 | language stringclasses 2 values | original_status stringclasses 3 values | original_src stringlengths 19 243k | changed_src stringlengths 19 243k | change stringclasses 3 values | i1 int64 0 8.44k | i2 int64 0 8.44k | j1 int64 0 8.44k | j2 int64 0 8.44k | error stringclasses 270 values | stderr stringlengths 0 226k |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02414 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int n, m, l;
long long A[1000][1000], B[1000][1000], C[1000][1000];
cin >> n >> m >> l;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
cin >> A[i][j];
for (int i = 0; i < m; i++)
for (int j = 0; j < l; j++)
cin >> B[i][j];
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
C[i][j] = 0;
for (int k = 0; k < m; k++) {
C[i][j] += A[i][k] * B[k][j];
}
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
if (j)
cout << " ";
cout << C[i][j];
}
cout << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
int n, m, l;
long long A[100][100], B[100][100], C[100][100];
cin >> n >> m >> l;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
cin >> A[i][j];
for (int i = 0; i < m; i++)
for (int j = 0; j < l; j++)
cin >> B[i][j];
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
C[i][j] = 0;
for (int k = 0; k < m; k++) {
C[i][j] += A[i][k] * B[k][j];
}
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
if (j)
cout << " ";
cout << C[i][j];
}
cout << endl;
}
return 0;
} | replace | 5 | 6 | 5 | 6 | -11 | |
p02414 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
long int n, m, l, A[100][100], B[100][100], C[100][100] = {};
cin >> n >> m >> l;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> A[i][j];
}
}
for (int i = 0; i < m; i++) {
for (int j = 0; j < l; j++) {
cin >> B[i][j];
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m;) {
for (int k = 0; k < l; k++) {
C[i][k] += A[i][j] * B[j][k];
}
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
if (j != l - 1)
cout << C[i][j] << " ";
else
cout << C[i][j] << endl;
}
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
long int n, m, l, A[100][100], B[100][100], C[100][100] = {};
cin >> n >> m >> l;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> A[i][j];
}
}
for (int i = 0; i < m; i++) {
for (int j = 0; j < l; j++) {
cin >> B[i][j];
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
for (int k = 0; k < l; k++) {
C[i][k] += A[i][j] * B[j][k];
}
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
if (j != l - 1)
cout << C[i][j] << " ";
else
cout << C[i][j] << endl;
}
}
return 0;
}
| replace | 20 | 21 | 20 | 21 | TLE | |
p02414 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
long int n, m, l, a[100][100], b[100][100], r[100][100], i, j, k;
for (i = 0; i < 100; i++) {
for (j = 0; j < 100; j++) {
a[i][j] = 0;
b[i][j] = 0;
r[i][j] = 0;
}
}
cin >> n >> m >> l;
if (n < 100 || m < 100 || l < 100) {
cout << "Too Large" << endl;
return 1;
}
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
cin >> a[i][j];
if (a[i][j] > 10000) {
cout << " Too Large" << endl;
return 1;
}
}
}
for (i = 0; i < m; i++) {
for (j = 0; j < l; j++) {
cin >> b[i][j];
if (b[i][j] > 10000) {
cout << "Too Large" << endl;
return 1;
}
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < l; j++) {
for (k = 0; k < m; k++) {
r[i][j] += (a[i][k] * b[k][j]);
}
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < l; j++) {
cout << r[i][j];
if (j != l - 1)
cout << " ";
else
cout << endl;
}
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
long int n, m, l, a[100][100], b[100][100], r[100][100], i, j, k;
for (i = 0; i < 100; i++) {
for (j = 0; j < 100; j++) {
a[i][j] = 0;
b[i][j] = 0;
r[i][j] = 0;
}
}
cin >> n >> m >> l;
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
cin >> a[i][j];
if (a[i][j] > 10000) {
cout << " Too Large" << endl;
return 1;
}
}
}
for (i = 0; i < m; i++) {
for (j = 0; j < l; j++) {
cin >> b[i][j];
if (b[i][j] > 10000) {
cout << "Too Large" << endl;
return 1;
}
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < l; j++) {
for (k = 0; k < m; k++) {
r[i][j] += (a[i][k] * b[k][j]);
}
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < l; j++) {
cout << r[i][j];
if (j != l - 1)
cout << " ";
else
cout << endl;
}
}
return 0;
} | delete | 13 | 17 | 13 | 13 | 1 | |
p02414 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, l;
cin >> n >> m >> l;
int a[100][100];
int b[100][100];
int c[100][100] = {};
for (int i = 1; i <= n; i++) {
for (int g = 1; g <= m; g++) {
cin >> a[i][g];
}
}
for (int i = 1; i <= m; i++) {
for (int g = 1; g <= l; g++) {
cin >> b[i][g];
}
}
for (int h = 1; h <= l; h++) {
for (int i = 1; i <= n; i++) {
for (int g = 1; g <= m; g++) {
c[i][h] += a[i][g] * b[g][h];
}
}
}
for (int i = 1; i <= n; i++) {
for (int g = 1; g <= l; g++) {
cout << c[i][g];
if (g < l) {
cout << " ";
}
}
cout << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, l;
cin >> n >> m >> l;
int a[200][200];
int b[200][200];
long long c[200][200] = {};
for (int i = 1; i <= n; i++) {
for (int g = 1; g <= m; g++) {
cin >> a[i][g];
}
}
for (int i = 1; i <= m; i++) {
for (int g = 1; g <= l; g++) {
cin >> b[i][g];
}
}
for (int h = 1; h <= l; h++) {
for (int i = 1; i <= n; i++) {
for (int g = 1; g <= m; g++) {
c[i][h] += a[i][g] * b[g][h];
}
}
}
for (int i = 1; i <= n; i++) {
for (int g = 1; g <= l; g++) {
cout << c[i][g];
if (g < l) {
cout << " ";
}
}
cout << endl;
}
return 0;
}
| replace | 6 | 9 | 6 | 9 | 0 | |
p02414 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int n, m, l;
cin >> n >> m >> l;
int A[10000][10000], B[10000][10000], C[10000][10000];
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> A[i][j];
}
}
for (int a = 0; a < m; a++) {
for (int b = 0; b < l; b++) {
cin >> B[a][b];
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
for (int k = 0; k < m; k++) {
C[i][j] += A[i][k] * B[k][j];
}
}
}
for (int c = 0; c < n; c++) {
for (int d = 0; d < l - 1; d++) {
cout << C[c][d] << " ";
}
cout << C[c][l - 1] << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int n, m, l;
cin >> n >> m >> l;
int A[100][100], B[100][100];
long long int C[1000][1000];
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> A[i][j];
}
}
for (int a = 0; a < m; a++) {
for (int b = 0; b < l; b++) {
cin >> B[a][b];
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
for (int k = 0; k < m; k++) {
C[i][j] += A[i][k] * B[k][j];
}
}
}
for (int c = 0; c < n; c++) {
for (int d = 0; d < l - 1; d++) {
cout << C[c][d] << " ";
}
cout << C[c][l - 1] << endl;
}
return 0;
}
| replace | 6 | 7 | 6 | 8 | -11 | |
p02414 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main(void) {
// Your code here!
int n, m, l;
cin >> n >> m >> l;
int ue[100][100] = {};
int sit[100][100] = {};
int kam[10000][10000] = {};
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> ue[i][j];
}
}
for (int i = 0; i < m; i++) {
for (int j = 0; j < l; j++) {
cin >> sit[i][j];
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
for (int k = 0; k < m; k++) {
kam[i][j] += ue[i][k] * sit[k][j];
}
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
cout << kam[i][j];
if (j != l - 1)
cout << " ";
}
cout << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main(void) {
// Your code here!
int n, m, l;
cin >> n >> m >> l;
long long ue[101][101] = {};
long long sit[101][101] = {};
long long kam[101][101] = {};
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> ue[i][j];
}
}
for (int i = 0; i < m; i++) {
for (int j = 0; j < l; j++) {
cin >> sit[i][j];
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
for (int k = 0; k < m; k++) {
kam[i][j] += ue[i][k] * sit[k][j];
}
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
cout << kam[i][j];
if (j != l - 1)
cout << " ";
}
cout << endl;
}
return 0;
}
| replace | 6 | 9 | 6 | 9 | -11 | |
p02414 | C++ | Time Limit Exceeded | #include <stdio.h>
#define V 100
int main() {
int i, j, k;
int n, m, l;
int a[V][V], b[V][V];
long int c[V][V];
scanf("%d %d %d", &n, &m, &l);
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
a[i][j] = 0;
}
}
for (i = 0; i < m; i++) {
for (j = 0; j < l; j++) {
b[i][j] = 0;
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < l; j++) {
c[i][j] = 0;
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
scanf("%d", &a[i][j]);
}
}
for (i = 0; i < m; i++) {
for (j = 0; j < l; j++) {
scanf("%d", &b[i][j]);
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < l; j++) {
for (k = 0; k < m; k++) {
c[i][j] += a[i][k] * b[k][j];
}
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < l; j++) {
if (j = 0) {
printf("%li", c[i][j]);
} else {
printf("% li", c[i][j]);
}
}
printf("\n");
}
}
| #include <stdio.h>
#define V 100
int main() {
int i, j, k;
int n, m, l;
int a[V][V], b[V][V];
long int c[V][V];
scanf("%d %d %d", &n, &m, &l);
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
a[i][j] = 0;
}
}
for (i = 0; i < m; i++) {
for (j = 0; j < l; j++) {
b[i][j] = 0;
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < l; j++) {
c[i][j] = 0;
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
scanf("%d", &a[i][j]);
}
}
for (i = 0; i < m; i++) {
for (j = 0; j < l; j++) {
scanf("%d", &b[i][j]);
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < l; j++) {
for (k = 0; k < m; k++) {
c[i][j] += a[i][k] * b[k][j];
}
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < l; j++) {
if (j == 0) {
printf("%li", c[i][j]);
} else {
printf("% li", c[i][j]);
}
}
printf("\n");
}
}
| replace | 46 | 47 | 46 | 47 | TLE | |
p02414 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
long a[100][100], b[100][100], c[100][100] = {{0}};
int n, m, l;
cin >> n >> m >> l;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
cin >> a[i][j];
}
}
for (int j = 1; j <= m; j++) {
for (int k = 1; k <= l; k++) {
cin >> b[j][k];
}
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= l; j++) {
for (int k = 1; k <= m; k++) {
c[i][j] += a[i][k] * b[k][j];
}
}
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= l; j++) {
if (j == 1)
cout << c[i][j];
else
cout << " " << c[i][j];
}
cout << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
long a[105][105], b[105][105], c[105][105] = {{0}};
int n, m, l;
cin >> n >> m >> l;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
cin >> a[i][j];
}
}
for (int j = 1; j <= m; j++) {
for (int k = 1; k <= l; k++) {
cin >> b[j][k];
}
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= l; j++) {
for (int k = 1; k <= m; k++) {
c[i][j] += a[i][k] * b[k][j];
}
}
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= l; j++) {
if (j == 1)
cout << c[i][j];
else
cout << " " << c[i][j];
}
cout << endl;
}
return 0;
}
| replace | 4 | 5 | 4 | 5 | 0 | |
p02415 | C++ | Time Limit Exceeded | #include <cctype>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
char s;
while (1) {
cin >> s;
if (isalpha(s)) {
if (islower(s))
cout << (char)toupper(s);
else if (isupper(s))
cout << (char)tolower(s);
} else {
cout << s;
}
if (s == '\n')
break;
}
return 0;
} | #include <cctype>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
char s;
while (1) {
scanf("%c", &s);
if (isalpha(s)) {
if (islower(s))
cout << (char)toupper(s);
else if (isupper(s))
cout << (char)tolower(s);
} else {
cout << s;
}
if (s == '\n')
break;
}
return 0;
} | replace | 8 | 9 | 8 | 9 | TLE | |
p02415 | C++ | Time Limit Exceeded | #include <cctype>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
char ch;
while (1) {
scanf("%c", &ch);
if (isalpha(ch)) {
if (islower(ch))
printf("%c", toupper(ch));
else
printf("%c", tolower(ch));
} else
printf("%c", ch);
}
}
| #include <cctype>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
char ch;
while (1) {
scanf("%c", &ch);
if (isalpha(ch)) {
if (islower(ch))
printf("%c", toupper(ch));
else
printf("%c", tolower(ch));
} else
printf("%c", ch);
if (ch == '\n')
break;
}
}
| insert | 15 | 15 | 15 | 18 | TLE | |
p02415 | C++ | Time Limit Exceeded | #include <cstdio>;
// 入出力を行う関数が使える//(scanf,printf)
#include <cctype>;
// 文字の種類の判定や文字の変換を行う関数を使うことができる//
int main() {
char ch;
while (true) {
scanf("%c", ch);
// 文字(1文字)として入力する//
if (isalpha(ch)) {
// chがアルファベットならtrueを返す//
if (islower(ch))
printf("%c", toupper(ch));
// chが小文字ならtrueを返す// //chの大文字を返す//
else
printf("%c", tolower(ch));
// chの小文字を返す//
} else
printf("%c", ch);
// アルファベット以外はそのまま出力//
if (ch == '\n')
break;
// 終端文字が現れたら終了//
}
return 0;
}
| #include <cstdio>;
// 入出力を行う関数が使える//(scanf,printf)
#include <cctype>;
// 文字の種類の判定や文字の変換を行う関数を使うことができる//
int main() {
char ch;
while (true) {
scanf("%c", &ch);
// 文字(1文字)として入力する//
if (isalpha(ch)) {
// chがアルファベットならtrueを返す//
if (islower(ch))
printf("%c", toupper(ch));
// chが小文字ならtrueを返す// //chの大文字を返す//
else
printf("%c", tolower(ch));
// chの小文字を返す//
} else
printf("%c", ch);
// アルファベット以外はそのまま出力//
if (ch == '\n')
break;
// 終端文字が現れたら終了//
}
return 0;
}
| replace | 9 | 10 | 9 | 10 | TLE | |
p02415 | C++ | Runtime Error | #include <cstdio>;
// 入出力を行う関数が使える//(scanf,printf)
#include <cctype>;
int main() {
char ch;
while (true) {
scanf("%c,&ch");
if (isalpha(ch)) {
// chがアルファベットならtrueを返す//
if (islower(ch))
printf("%c", toupper(ch));
// chが小文字ならtrueを返す// //chの大文字を返す//
else
printf("%c", tolower(ch));
// chの小文字を返す//
} else
printf("%c", ch);
// アルファベット以外はそのまま出力//
if (ch == '\n')
break;
// 終端文字が現れたら終了//
}
return 0;
}
| #include <cstdio>;
// 入出力を行う関数が使える//(scanf,printf)
#include <cctype>;
int main() {
char ch;
while (true) {
scanf("%c", &ch);
if (isalpha(ch)) {
// chがアルファベットならtrueを返す//
if (islower(ch))
printf("%c", toupper(ch));
// chが小文字ならtrueを返す// //chの大文字を返す//
else
printf("%c", tolower(ch));
// chの小文字を返す//
} else
printf("%c", ch);
// アルファベット以外はそのまま出力//
if (ch == '\n')
break;
// 終端文字が現れたら終了//
}
return 0;
}
| replace | 8 | 9 | 8 | 9 | -11 | |
p02415 | C++ | Time Limit Exceeded | #include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int main() {
char ch, ch2;
while (1) {
scanf("%c", &ch);
if (islower(ch)) {
ch2 = toupper(ch);
cout << ch2;
} else {
ch2 = tolower(ch);
cout << ch2;
}
if (ch == ' \n') {
break;
}
}
return 0;
} | #include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int main() {
char ch, ch2;
while (1) {
scanf("%c", &ch);
if (islower(ch)) {
ch2 = toupper(ch);
cout << ch2;
} else {
ch2 = tolower(ch);
cout << ch2;
}
if (ch == '\n') {
break;
}
}
return 0;
} | replace | 18 | 19 | 18 | 20 | TLE | |
p02415 | C++ | Time Limit Exceeded | #include <cctype>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
char ch;
while (1) {
cin >> ch;
if (isalpha(ch)) {
if (islower(ch))
printf("%c", toupper(ch));
else
printf("%c", tolower(ch));
} else
printf("%c", ch);
if (ch == '\n')
break;
}
return 0;
}
| #include <cctype>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
char ch;
while (1) {
scanf("%c", &ch);
if (isalpha(ch)) {
if (islower(ch))
printf("%c", toupper(ch));
else
printf("%c", tolower(ch));
} else
printf("%c", ch);
if (ch == '\n')
break;
}
return 0;
}
| replace | 9 | 10 | 9 | 10 | TLE | |
p02415 | Python | Runtime Error | print(input().swapcase())
s = input()
for c in s:
if c.islower():
print(c.upper(), end="")
else:
print(c.lower(), end="")
print()
| s = input()
for c in s:
if c.islower():
print(c.upper(), end="")
else:
print(c.lower(), end="")
print()
| delete | 0 | 2 | 0 | 0 | EOFError: EOF when reading a line | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02415/Python/s623323382.py", line 3, in <module>
s = input()
EOFError: EOF when reading a line
|
p02415 | C++ | Time Limit Exceeded | #include <cctype>
#include <cstdio>
#include <iostream>
using namespace std;
int main(void) {
char s;
while (1) {
scanf("%c", &s);
if (islower(s) == 1) {
cout << toupper(s);
} else if (isupper(s) == 1) {
cout << tolower(s);
} else {
cout << s;
}
}
cout << endl;
return 0;
} | #include <cctype>
#include <cstdio>
#include <iostream>
using namespace std;
int main(void) {
char s;
while (1) {
scanf("%c", &s);
if (s == '\n') {
break;
}
if (islower(s)) {
printf("%c", toupper(s));
} else if (isupper(s)) {
printf("%c", tolower(s));
} else {
cout << s;
}
}
cout << endl;
return 0;
} | replace | 9 | 13 | 9 | 16 | TLE | |
p02415 | C++ | Time Limit Exceeded | #include <cctype>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef vector<int> vec;
int main() {
char ch;
while (1) {
scanf("%c", &ch);
if (islower(ch))
printf("%c", toupper(ch));
else
printf("%c", tolower(ch));
if (ch == '\0')
break;
}
} | #include <cctype>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef vector<int> vec;
int main() {
char ch;
while (1) {
scanf("%c", &ch);
if (islower(ch))
printf("%c", toupper(ch));
else
printf("%c", tolower(ch));
if (ch == '\n')
break;
}
} | replace | 17 | 18 | 17 | 18 | TLE | |
p02415 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string mozi;
getline(cin, mozi);
for (int i = 0; (int)mozi.size(); i++) {
if (islower(mozi[i])) {
mozi[i] = toupper(mozi[i]);
} else if (isupper(mozi[i])) {
mozi[i] = tolower(mozi[i]);
}
}
cout << mozi << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string mozi;
getline(cin, mozi);
for (int i = 0; i < (int)mozi.size(); i++) {
if (islower(mozi[i])) {
mozi[i] = toupper(mozi[i]);
} else if (isupper(mozi[i])) {
mozi[i] = tolower(mozi[i]);
}
}
cout << mozi << endl;
return 0;
}
| replace | 9 | 10 | 9 | 10 | -11 | |
p02415 | C++ | Time Limit Exceeded | #include <cctype>
#include <cstdio>
int main() {
char ch;
while (1) {
scanf("%c", &ch);
if (islower(ch))
printf("%c", toupper(ch));
else if (isupper(ch))
printf("%c", tolower(ch));
else if (!isalpha(ch))
printf("%c", ch);
else if (ch == '\n')
break;
}
return 0;
}
| #include <cctype>
#include <cstdio>
int main() {
char ch;
while (1) {
scanf("%c", &ch);
if (islower(ch))
printf("%c", toupper(ch));
else if (isupper(ch))
printf("%c", tolower(ch));
else if (!isalpha(ch))
printf("%c", ch);
if (ch == '\n')
break;
}
return 0;
}
| replace | 14 | 15 | 14 | 15 | TLE | |
p02415 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int main(void) {
string komozi("abcdefghijklmnopqrstuvwxyz");
string oomozi("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
char inp;
char retsu[1000000];
for (int i = 0;; i++) {
inp = getchar();
if (inp == '.') {
retsu[i] = '.';
retsu[i + 1] = '\0';
break;
}
if (komozi.find(inp) != -1)
retsu[i] = oomozi[komozi.find(inp)];
else if (oomozi.find(inp) != -1)
retsu[i] = komozi[oomozi.find(inp)];
else
retsu[i] = inp;
}
cout << retsu << endl;
return 0;
} | #include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int main(void) {
string komozi("abcdefghijklmnopqrstuvwxyz");
string oomozi("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
char inp;
char retsu[1000000];
for (int i = 0;; i++) {
inp = getchar();
if (inp == '\n') {
retsu[i + 1] = '\0';
break;
}
if (komozi.find(inp) != -1)
retsu[i] = oomozi[komozi.find(inp)];
else if (oomozi.find(inp) != -1)
retsu[i] = komozi[oomozi.find(inp)];
else
retsu[i] = inp;
}
cout << retsu << endl;
return 0;
} | replace | 15 | 17 | 15 | 16 | 0 | |
p02415 | C++ | Time Limit Exceeded | #include <cctype>
#include <cstdio>
using namespace std;
int main() {
char ch;
while (1) {
scanf("%c", &ch);
if (isalpha(ch)) {
if (islower(ch))
printf("%c", toupper(ch));
else
printf("%c", tolower(ch));
} else
printf("%c", ch);
}
return 0;
}
| #include <cctype>
#include <cstdio>
using namespace std;
int main() {
char ch;
while (1) {
scanf("%c", &ch);
if (isalpha(ch)) {
if (islower(ch))
printf("%c", toupper(ch));
else
printf("%c", tolower(ch));
} else
printf("%c", ch);
if (ch == '\n')
break;
}
return 0;
}
| insert | 14 | 14 | 14 | 16 | TLE | |
p02415 | C++ | Time Limit Exceeded | #include <cctype>
#include <cstdio>
int main() {
char ch;
while (1) {
scanf("%c", &ch);
if (isalpha(ch)) {
if (islower(ch))
printf("%c", toupper(ch));
else
printf("%c", tolower(ch));
} else
printf("%c", ch);
if (ch == '/n')
break;
}
return 0;
} | #include <cctype>
#include <cstdio>
int main() {
char ch;
while (1) {
scanf("%c", &ch);
if (isalpha(ch)) {
if (islower(ch))
printf("%c", toupper(ch));
else
printf("%c", tolower(ch));
} else
printf("%c", ch);
if (ch == '\n')
break;
}
return 0;
} | replace | 13 | 14 | 13 | 14 | TLE | |
p02415 | C++ | Time Limit Exceeded | #include <cctype>
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
char ch;
while (1) {
scanf(" %c", &ch);
if (isupper(ch))
cout << (char)tolower(ch);
else if (islower(ch))
cout << (char)toupper(ch);
else {
if (ch == '\n')
break;
cout << ch;
}
}
cout << endl;
return 0;
} | #include <cctype>
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
char ch;
while (1) {
scanf("%c", &ch);
if (isupper(ch))
cout << (char)tolower(ch);
else if (islower(ch))
cout << (char)toupper(ch);
else {
if (ch == '\n')
break;
cout << ch;
}
}
cout << endl;
return 0;
} | replace | 8 | 9 | 8 | 9 | TLE | |
p02415 | C++ | Time Limit Exceeded | #include <ctype.h>
#include <stdio.h>
int main() {
char a[1200];
int i;
while (1) {
scanf("%c", &a[i]);
if (isupper(a[i])) {
printf("%c", tolower(a[i]));
} else if (islower(a[i])) {
printf("%c", toupper(a[i]));
} else {
printf("%c", a[i]);
}
}
return 0;
} | #include <ctype.h>
#include <stdio.h>
int main() {
char a[1200];
int i;
while (1) {
scanf("%c", &a[i]);
if (a[i] == '\n') {
printf("\n");
break;
}
if (isupper(a[i])) {
printf("%c", tolower(a[i]));
} else if (islower(a[i])) {
printf("%c", toupper(a[i]));
} else {
printf("%c", a[i]);
}
}
return 0;
} | insert | 7 | 7 | 7 | 11 | TLE | |
p02416 | C++ | Runtime Error | #include <cctype>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
using namespace std;
int main() {
string number;
int sum;
while (1) {
sum = 0;
// while(1){
// cin >> number;
scanf("%s", &number);
// if(number == '\n')break;
// }
if (number[0] == '0' && number.size() == 1)
break;
for (int i = 0; i < number.size(); i++) {
sum += number[i] - '0';
number[i] = '0';
}
cout << sum << endl;
}
return 0;
}
| #include <cctype>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
using namespace std;
int main() {
string number;
int sum;
while (1) {
sum = 0;
// while(1){
cin >> number;
// scanf("%s",&number);
// if(number == '\n')break;
// }
if (number[0] == '0' && number.size() == 1)
break;
for (int i = 0; i < number.size(); i++) {
sum += number[i] - '0';
number[i] = '0';
}
cout << sum << endl;
}
return 0;
}
| replace | 14 | 16 | 14 | 16 | -11 | |
p02416 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main(void) {
int s, l, k, j, i;
string n, m[100] = {};
k = 0;
do {
k = k + 1;
cin >> n;
m[k] = n;
} while (n != "0");
j = k - 1;
for (k = 1; k <= j; k++) {
i = m[k].size();
s = 0;
for (l = 0; l <= i - 1; l++)
s = s + (m[k][l] - '0');
cout << s << endl;
}
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main(void) {
int s, l, k, j, i;
string n, m[1001] = {};
k = 0;
do {
k = k + 1;
cin >> n;
m[k] = n;
} while (n != "0");
j = k - 1;
for (k = 1; k <= j; k++) {
i = m[k].size();
s = 0;
for (l = 0; l <= i - 1; l++)
s = s + (m[k][l] - '0');
cout << s << endl;
}
return 0;
} | replace | 6 | 7 | 6 | 7 | 0 | |
p02416 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
char str[100];
while (true) {
cin >> str;
if (str[0] == '0')
break;
int sum = 0;
for (int i = 0; i < strlen(str); i++) {
sum += (str[i] - '0');
}
printf("%d\n", sum);
}
return 0;
} | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
char str[1001];
while (true) {
cin >> str;
if (str[0] == '0')
break;
int sum = 0;
for (int i = 0; i < strlen(str); i++) {
sum += (str[i] - '0');
}
printf("%d\n", sum);
}
return 0;
} | replace | 7 | 8 | 7 | 8 | 0 | |
p02416 | C++ | Runtime Error | #include <iostream>
using namespace std;
#include <cstdio>
#include <stdio.h>
int main() {
int num = 0;
char fig[5];
while (1) {
scanf("%s", fig);
if (fig == "0")
break;
for (int i = 0; fig[i] != '\0'; i++) {
num += fig[i] - '0';
}
if (num == 0)
break;
printf("%d\n", num);
num = 0;
}
return 0;
}
| #include <iostream>
using namespace std;
#include <cstdio>
#include <stdio.h>
int main() {
int num = 0;
char fig[1001];
while (1) {
scanf("%s", fig);
if (fig == "0")
break;
for (int i = 0; fig[i] != '\0'; i++) {
num += fig[i] - '0';
}
if (num == 0)
break;
printf("%d\n", num);
num = 0;
}
return 0;
}
| replace | 8 | 9 | 8 | 9 | 0 | |
p02416 | C++ | Time Limit Exceeded | #include <cstdio>
#include <cstring>
using namespace std;
int main() {
char str[1001];
while (1) {
scanf("%s", str);
if (str[0] == 0)
break;
int sum = 0;
for (int i = 0; i < strlen(str); i++) {
int a = str[i] - '0';
sum += a;
}
printf("%d\n", sum);
}
return 0;
}
| #include <cstdio>
#include <cstring>
using namespace std;
int main() {
char str[1001];
while (1) {
scanf("%s", str);
if (str[0] == '0')
break;
int sum = 0;
for (int i = 0; i < strlen(str); i++) {
int a = str[i] - '0';
sum += a;
}
printf("%d\n", sum);
}
return 0;
}
| replace | 7 | 8 | 7 | 8 | TLE | |
p02416 | C++ | Runtime Error | #include <iostream>
int sum_each_digit() {
char x[5];
int ans = 0;
std::cin >> x;
if (x[0] == '0')
return -1;
for (int i = 0; x[i] != '\0'; i++) {
ans += (int)x[i] - 48;
}
return ans;
}
int main() {
int ans;
while (true) {
ans = sum_each_digit();
if (ans == -1)
break;
std::cout << ans << std::endl;
}
return 0;
}
| #include <iostream>
int sum_each_digit() {
char x[1001];
int ans = 0;
std::cin >> x;
if (x[0] == '0')
return -1;
for (int i = 0; x[i] != '\0'; i++) {
ans += (int)x[i] - 48;
}
return ans;
}
int main() {
int ans;
while (true) {
ans = sum_each_digit();
if (ans == -1)
break;
std::cout << ans << std::endl;
}
return 0;
}
| replace | 3 | 4 | 3 | 4 | 0 | |
p02416 | C++ | Time Limit Exceeded | #include <cctype>
#include <cstdio>
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main() {
while (true) {
char b[1000] = "0";
cin.getline(b, sizeof(b));
char c[strlen(b)];
strcpy(c, b);
if (c[0] != '0') {
int x = 0;
for (int k = 0; k < strlen(c); k++) {
int n;
n = c[k] - '0';
x += n;
}
cout << x << endl;
} else {
break;
}
}
return 0;
}
| #include <cctype>
#include <cstdio>
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main() {
while (true) {
char b[1001] = "0";
cin.getline(b, sizeof(b));
char c[strlen(b)];
strcpy(c, b);
if (c[0] != '0') {
int x = 0;
for (int k = 0; k < strlen(c); k++) {
int n;
n = c[k] - '0';
x += n;
}
cout << x << endl;
} else {
break;
}
}
return 0;
}
| replace | 9 | 10 | 9 | 10 | TLE | |
p02416 | C++ | Time Limit Exceeded | #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
char num[1001];
while (1) {
int a = 0;
scanf("%s", num);
if (num[0] == 0)
break;
for (int i = 0; num[i] != '\0'; i++) {
a += num[i] - '0';
}
printf("%d\n", a);
}
}
| #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
char num[1001];
while (1) {
int a = 0;
scanf("%s", num);
if (num[0] == '0')
break;
for (int i = 0; num[i] != '\0'; i++) {
a += num[i] - '0';
}
printf("%d\n", a);
}
}
| replace | 8 | 9 | 8 | 9 | TLE | |
p02416 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
int main() {
char str[5];
while (true) {
scanf("%s", str);
if (str[0] == '0')
break;
int sum = 0;
for (int i = 0; i < strlen(str); i++) {
sum += str[i] - '0';
}
printf("%d\n", sum);
}
return 0;
} | #include <cstdio>
#include <cstring>
int main() {
char str[1001];
while (true) {
scanf("%s", str);
if (str[0] == '0')
break;
int sum = 0;
for (int i = 0; i < strlen(str); i++) {
sum += str[i] - '0';
}
printf("%d\n", sum);
}
return 0;
} | replace | 3 | 4 | 3 | 4 | 0 | |
p02416 | C++ | Time Limit Exceeded | #include <cstdio>
#include <cstring>
using namespace std;
int main() {
char ch[1001];
while (1) {
scanf("%s", ch);
if (ch[0] == 0)
break;
int sum = 0;
for (int i = 0; i < strlen(ch); i++) {
sum += (ch[i] - '0');
}
printf("%d\n", sum);
}
return 0;
} | #include <cstdio>
#include <cstring>
using namespace std;
int main() {
char ch[1001];
while (1) {
scanf("%s", ch);
if (ch[0] == '0')
break;
int sum = 0;
for (int i = 0; i < strlen(ch); i++) {
sum += (ch[i] - '0');
}
printf("%d\n", sum);
}
return 0;
} | replace | 10 | 11 | 10 | 11 | TLE | |
p02416 | C++ | Time Limit Exceeded | //???????????????????????????Aizu??§???runnning
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
int b, i;
int sum = 0;
char x[1001]; //?????????
while (1) {
cin >> x;
// x=0?????¨?????????
sum = 0;
if (x[0] == 0)
break;
for (i = 0; x[i] != 0; i++) {
b = x[i] - '0'; //?????????x?????????i?????°????????????
sum += b;
}
cout << sum << endl;
}
return 0;
}
| //???????????????????????????Aizu??§???runnning
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
int b, i;
int sum = 0;
char x[1001]; //?????????
while (1) {
cin >> x;
// x=0?????¨?????????
sum = 0;
if (x[0] == '0')
break;
for (i = 0; x[i] != 0; i++) {
b = x[i] - '0'; //?????????x?????????i?????°????????????
sum += b;
}
cout << sum << endl;
}
return 0;
}
| replace | 14 | 15 | 14 | 15 | TLE | |
p02416 | C++ | Time Limit Exceeded | #include <cctype>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef vector<int> vec;
int main() {
string n;
while (1) {
cin >> n;
int sum = 0;
rep(i, n.size()) { sum += (int)(n[i] - '0'); }
cout << sum << endl;
}
} | #include <cctype>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef vector<int> vec;
int main() {
string n;
while (1) {
cin >> n;
if (n == "0")
break;
int sum = 0;
rep(i, n.size()) { sum += (int)(n[i] - '0'); }
cout << sum << endl;
}
} | insert | 13 | 13 | 13 | 15 | TLE | |
p02416 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
int d;
string num;
for (int i = 0;; i++) {
getline(cin, num);
if (num[i] == '0')
break;
d = 0;
for (int j = 0; j < num.length(); j++) {
d += num[j] - '0';
}
cout << d << "\n";
}
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
int d;
string num;
for (int i = 0;; i++) {
getline(cin, num);
if (num[0] == '0')
break;
d = 0;
for (int j = 0; j < num.length(); j++) {
d += num[j] - '0';
}
cout << d << "\n";
}
return 0;
} | replace | 12 | 13 | 12 | 13 | 0 | |
p02416 | C++ | Runtime Error | #include <cctype>
#include <cstdio>
int main() {
int sum;
char line[6];
while (true) {
sum = 0;
scanf("%s", line);
for (int i = 0; isdigit(line[i]); i++) {
sum += line[i] - '0';
}
if (sum == 0) {
break;
}
printf("%d\n", sum);
}
return 0;
}
| #include <cctype>
#include <cstdio>
int main() {
int sum;
char line[1002];
while (true) {
sum = 0;
scanf("%s", line);
for (int i = 0; isdigit(line[i]); i++) {
sum += line[i] - '0';
}
if (sum == 0) {
break;
}
printf("%d\n", sum);
}
return 0;
}
| replace | 5 | 6 | 5 | 6 | 0 | |
p02416 | C++ | Time Limit Exceeded | #include <cstdio>
#include <cstring>
int main() {
char number[1000];
while (1) {
scanf("%s", number);
if (number[0] == 0)
break;
int sum = 0;
for (int i = 0; i < strlen(number); i++) {
sum += (number[i] - '0');
}
printf("%d\n", sum);
}
return 0;
} | #include <cstdio>
#include <cstring>
int main() {
char number[1000];
while (1) {
scanf("%s", number);
if (number[0] == '0')
break;
int sum = 0;
for (int i = 0; i < strlen(number); i++) {
sum += (number[i] - '0');
}
printf("%d\n", sum);
}
return 0;
} | replace | 7 | 8 | 7 | 8 | TLE | |
p02416 | C++ | Time Limit Exceeded | #include <stdio.h>
int main() {
char moji[1001];
int sum, cou, tn;
while (1) {
scanf("%s", moji);
if (moji[0] = '\0') {
break;
}
sum = 0;
cou = 0;
while (1) {
if (moji[cou] == '\0') {
break;
}
tn = moji[cou] - '0';
sum = sum + tn;
cou = cou + 1;
}
printf("%d\n", sum);
}
return 0;
} | #include <stdio.h>
int main() {
char moji[1001];
int sum, cou, tn;
while (1) {
scanf("%s", moji);
if (moji[0] == '0') {
break;
}
sum = 0;
cou = 0;
while (1) {
if (moji[cou] == '\0') {
break;
}
tn = moji[cou] - '0';
sum = sum + tn;
cou = cou + 1;
}
printf("%d\n", sum);
}
return 0;
}
| replace | 6 | 7 | 6 | 7 | TLE | |
p02416 | C++ | Runtime Error | #include <iostream>
#include <string>
int main() {
using namespace std;
string s;
int ans, x, y, size, i, j;
ans = 0;
i = 0;
x = 1;
while (x) {
cin >> s;
if (s == "0") {
break;
}
x = stoi(s);
size = s.size();
for (j = 0; j < size; j++) {
y = s[j] - '0';
ans = ans + y;
}
cout << ans << endl;
ans = 0;
}
return 0;
}
| #include <iostream>
#include <string>
int main() {
using namespace std;
string s;
int ans, x, y, size, i, j;
ans = 0;
i = 0;
x = 1;
while (x) {
cin >> s;
if (s == "0") {
break;
}
size = s.size();
for (j = 0; j < size; j++) {
y = s[j] - '0';
ans = ans + y;
}
cout << ans << endl;
ans = 0;
}
return 0;
}
| delete | 14 | 15 | 14 | 14 | 0 | |
p02416 | C++ | Time Limit Exceeded | #include <cstdio>
int main() {
char s[1201];
int c;
while (1) {
scanf("%[^\n]", s);
c = 0;
if (s[0] == '0') {
break;
}
for (int i = 0; s[i] != '\0'; i++) {
c += s[i] - 48;
}
printf("%d\n", c);
}
}
| #include <cstdio>
int main() {
char s[1201];
int c;
while (1) {
scanf("%s", s);
c = 0;
if (s[0] == '0') {
break;
}
for (int i = 0; s[i] != '\0'; i++) {
c += s[i] - 48;
}
printf("%d\n", c);
}
}
| replace | 6 | 7 | 6 | 7 | TLE | |
p02416 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
string str;
int count = 0;
int sum;
int a;
int offset;
string splitString;
vector<string> strList;
while (1) {
cin >> str;
if (str == "0") {
break;
}
strList.push_back(str);
count++;
}
for (int i = 0; i < count; i++) {
offset = 0;
sum = 0;
while (offset <= strList[i].length()) {
splitString = strList[i].substr(offset, 8);
a = stoi(splitString);
while (a > 0) {
sum += a % 10;
a /= 10;
}
offset += 8;
}
cout << sum << "\n";
}
return 0;
} | #include <cstdio>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
string str;
int count = 0;
int sum;
int a;
int offset;
string splitString;
vector<string> strList;
while (1) {
cin >> str;
if (str == "0") {
break;
}
strList.push_back(str);
count++;
}
for (int i = 0; i < count; i++) {
offset = 0;
sum = 0;
while (offset < strList[i].length()) {
splitString = strList[i].substr(offset, 8);
a = stoi(splitString);
while (a > 0) {
sum += a % 10;
a /= 10;
}
offset += 8;
}
cout << sum << "\n";
}
return 0;
} | replace | 32 | 33 | 32 | 33 | 0 | |
p02416 | C++ | Time Limit Exceeded | #include <iostream>
#include <string>
using namespace std;
int main() {
string x;
while (true) {
int answer;
answer = 0;
cin >> x;
for (int i = 0; i < x.size(); i++) {
answer += x[i] - '0';
}
cout << answer << endl;
}
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string x;
while (true) {
int answer;
answer = 0;
cin >> x;
if (x[0] == '0')
break;
for (int i = 0; i < x.size(); i++) {
answer += x[i] - '0';
}
cout << answer << endl;
}
return 0;
} | insert | 9 | 9 | 9 | 11 | TLE | |
p02416 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
char num[1001];
while (1) {
scanf("%s", num);
if (num[0] == '0')
break;
int sum = 0;
for (int i = 0; strlen(num) > i; i++) {
sum += num[i] - '0';
}
printf("%s\n", sum);
}
return 0;
}
| #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
char num[1001];
while (1) {
scanf("%s", num);
if (num[0] == '0')
break;
int sum = 0;
for (int i = 0; strlen(num) > i; i++) {
sum += num[i] - '0';
}
printf("%d\n", sum);
}
return 0;
}
| replace | 14 | 15 | 14 | 15 | -11 | |
p02416 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int i;
char number[5] = {0};
int sum = 0;
while (1) {
sum = 0;
cin >> number;
for (i = 0; number[i] != '\0'; i++) {
sum += number[i] - '0';
}
if (number[0] == '0')
break;
cout << sum << "\n";
}
} | #include <iostream>
using namespace std;
int main() {
int i;
char number[1001] = {0};
int sum = 0;
while (1) {
sum = 0;
cin >> number;
for (i = 0; number[i] != '\0'; i++) {
sum += number[i] - '0';
}
if (number[0] == '0')
break;
cout << sum << "\n";
}
} | replace | 6 | 7 | 6 | 7 | 0 | |
p02416 | C++ | Time Limit Exceeded | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
char str[1001];
while (1) {
scanf("%s", str);
}
}
| #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
char str[1001];
while (1) {
scanf("%s", str);
if (str[0] == '0')
break;
int sum = 0;
for (int i = 0; i < strlen(str); i++) {
sum += (str[i] - '0');
}
printf("%d\n", sum);
}
}
| insert | 8 | 8 | 8 | 15 | TLE | |
p02416 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cctype>
#include <math.h>
#include <stdio.h>
int main() {
char x[1001] = {0};
int sum = 0;
while (1) {
sum = 0;
scanf("%s", &x);
for (int i = 1; i <= 1000; i++) {
sum += x[i] - '0';
}
if (sum == 0) {
break;
} else {
printf("%d\n", sum);
}
}
return 0;
} | #include <algorithm>
#include <cctype>
#include <math.h>
#include <stdio.h>
int main() {
char x[1001] = {0};
int sum = 0;
while (1) {
sum = 0;
scanf("%s", &x);
for (int i = 0; x[i] != 0; i++) {
sum += x[i] - '0';
}
if (sum == 0) {
break;
} else {
printf("%d\n", sum);
}
}
return 0;
} | replace | 12 | 13 | 12 | 13 | TLE | |
p02416 | C++ | Time Limit Exceeded | #include <stdio.h>
#include <string.h>
int main() {
char x[1001];
int num;
bool f = 0;
while (1) {
scanf("%s", x);
if (x[0] == 0)
break;
int sum = 0;
for (int i = 0; i < strlen(x); i++) {
num = x[i] - '0';
sum += num;
}
printf("%d\n", sum);
}
} | #include <stdio.h>
#include <string.h>
int main() {
char x[1001];
int num;
bool f = 0;
while (1) {
scanf("%s", x);
if (x[0] == '0')
break;
int sum = 0;
for (int i = 0; i < strlen(x); i++) {
num = x[i] - '0';
sum += num;
}
printf("%d\n", sum);
}
} | replace | 9 | 10 | 9 | 10 | TLE | |
p02416 | C++ | Time Limit Exceeded | #include <stdio.h>
int main(void) {
int i;
while (1) {
char x[1001];
int sum = 0;
int re; //??°?????????????????´
scanf("%[^\n]", x); //?????????????????§????????????
if ((x[0] == '0') && (x[1] == '\0')) //??????0????????????
break;
for (i = 0; (!(x[i])) == '\0'; i++) { //??????????????????????????§?????????
re = x[i] - '0'; //??°?????¨?????????????????????
sum = sum + re; //????¨?????????????
}
printf("%d\n", sum);
}
return (0);
} | #include <stdio.h>
int main(void) {
int i;
while (1) {
char x[1001];
int sum = 0;
int re; //??°?????????????????´
scanf("%s", x);
if ((x[0] == '0') && (x[1] == '\0')) //??????0????????????
break;
for (i = 0; (!(x[i])) == '\0'; i++) { //??????????????????????????§?????????
re = x[i] - '0'; //??°?????¨?????????????????????
sum = sum + re; //????¨?????????????
}
printf("%d\n", sum);
}
return (0);
} | replace | 10 | 11 | 10 | 11 | TLE | |
p02416 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
int sum;
char ch[100];
while (1) {
scanf("%s", ch);
if (ch[0] == '0')
break;
sum = 0;
for (int i = 0; i < strlen(ch); i++) {
sum = sum + (ch[i] - '0');
}
printf("%d\n", sum);
}
} | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
int sum;
char ch[10000];
while (1) {
scanf("%s", ch);
if (ch[0] == '0')
break;
sum = 0;
for (int i = 0; i < strlen(ch); i++) {
sum = sum + (ch[i] - '0');
}
printf("%d\n", sum);
}
} | replace | 6 | 7 | 6 | 7 | 0 | |
p02416 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int sum[1001] = {};
int count = 0;
while (1) {
char in[1000];
int i = 0;
cin.getline(in, sizeof(in));
if (in[0] == '0') {
break;
}
for (i = 0; in[i] != '\0'; i++) {
if (in[i] == '1') {
sum[count] = sum[count] + 1;
} else if (in[i] == '2') {
sum[count] = sum[count] + 2;
} else if (in[i] == '3') {
sum[count] = sum[count] + 3;
} else if (in[i] == '4') {
sum[count] = sum[count] + 4;
} else if (in[i] == '5') {
sum[count] = sum[count] + 5;
} else if (in[i] == '6') {
sum[count] = sum[count] + 6;
} else if (in[i] == '7') {
sum[count] = sum[count] + 7;
} else if (in[i] == '8') {
sum[count] = sum[count] + 8;
} else if (in[i] == '9') {
sum[count] = sum[count] + 9;
}
}
count++;
}
for (int s = 0; s < count; s++) {
cout << sum[s] << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
int sum[1001] = {};
int count = 0;
while (1) {
char in[1001];
int i = 0;
cin.getline(in, sizeof(in));
if (in[0] == '0') {
break;
}
for (i = 0; in[i] != '\0'; i++) {
if (in[i] == '1') {
sum[count] = sum[count] + 1;
} else if (in[i] == '2') {
sum[count] = sum[count] + 2;
} else if (in[i] == '3') {
sum[count] = sum[count] + 3;
} else if (in[i] == '4') {
sum[count] = sum[count] + 4;
} else if (in[i] == '5') {
sum[count] = sum[count] + 5;
} else if (in[i] == '6') {
sum[count] = sum[count] + 6;
} else if (in[i] == '7') {
sum[count] = sum[count] + 7;
} else if (in[i] == '8') {
sum[count] = sum[count] + 8;
} else if (in[i] == '9') {
sum[count] = sum[count] + 9;
}
}
count++;
}
for (int s = 0; s < count; s++) {
cout << sum[s] << endl;
}
return 0;
} | replace | 8 | 9 | 8 | 9 | TLE | |
p02416 | Python | Runtime Error | while True:
x = input()
if x == 0:
break
length = len(x)
tot = 0
for i in range(length):
tot += int(x[i : i + 1])
print(tot)
| while True:
x = input()
if x == "0":
break
length = len(x)
tot = 0
for i in range(length):
tot += int(x[i : i + 1])
print(tot)
| replace | 3 | 4 | 3 | 4 | EOFError: EOF when reading a line | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02416/Python/s745703390.py", line 3, in <module>
x = input()
EOFError: EOF when reading a line
|
p02416 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
string number;
int sum[100];
int j = 0;
while (1) {
sum[j] = 0;
cin >> number;
if (number == "0") {
sum[j] = 0;
break;
}
for (int i = 0; i < number.length(); i++) {
sum[j] += number[i] - '0';
}
j++;
}
j = 0;
while (1) {
if (sum[j] == 0)
break;
cout << sum[j] << endl;
j++;
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
string number;
int sum[1000];
int j = 0;
while (1) {
sum[j] = 0;
cin >> number;
if (number == "0") {
sum[j] = 0;
break;
}
for (int i = 0; i < number.length(); i++) {
sum[j] += number[i] - '0';
}
j++;
}
j = 0;
while (1) {
if (sum[j] == 0)
break;
cout << sum[j] << endl;
j++;
}
return 0;
} | replace | 5 | 6 | 5 | 6 | 0 | |
p02416 | C++ | Runtime Error | #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int count, count2 = 0, ans[100] = {0};
char number[1000];
while (1) {
scanf("%s", &number);
for (count = 0; number[count] != '\0'; count++) {
ans[count2] += (number[count] - '0');
}
if (ans[count2] == 0) {
break;
}
count2++;
}
for (count = 0; count < count2; count++) {
cout << ans[count] << endl;
}
return 0;
} | #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int count, count2 = 0, ans[1000] = {0};
char number[1000];
while (1) {
scanf("%s", &number);
for (count = 0; number[count] != '\0'; count++) {
ans[count2] += (number[count] - '0');
}
if (ans[count2] == 0) {
break;
}
count2++;
}
for (count = 0; count < count2; count++) {
cout << ans[count] << endl;
}
return 0;
} | replace | 4 | 5 | 4 | 5 | 0 | |
p02416 | C++ | Runtime Error | #include <cstring>
#include <iostream>
using namespace std;
int main() {
while (1) {
int s = 0, d = 0;
char a[5];
cin >> a;
if (a[0] == 48)
break;
for (int i = 0; i < strlen(a); i++) {
s += a[i];
d++;
}
cout << s - d * 48 << endl;
}
return 0;
} | #include <cstring>
#include <iostream>
using namespace std;
int main() {
while (1) {
int s = 0, d = 0;
char a[1000];
cin >> a;
if (a[0] == 48)
break;
for (int i = 0; i < strlen(a); i++) {
s += a[i];
d++;
}
cout << s - d * 48 << endl;
}
return 0;
} | replace | 6 | 7 | 6 | 7 | 0 | |
p02416 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
char x[100][1001] = {"a"};
long long int check;
int a[100] = {};
for (int i = 0; i < 1000; i++) {
cin >> x[i];
if (x[i][0] == '0') {
break;
}
for (int i2 = 0; i2 < 1001; i2++) {
if (x[i][i2] != '\0' && x[i][i2] != 'a') {
a[i] += x[i][i2] - '0';
}
}
check = i;
}
for (int i = 0; i <= check; i++) {
cout << a[i] << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
char x[1000][1001] = {"a"};
int check;
int a[1000] = {};
for (int i = 0; i < 1000; i++) {
cin >> x[i];
if (x[i][0] == '0') {
break;
}
for (int i2 = 0; i2 < 1001; i2++) {
if (x[i][i2] != '\0' && x[i][i2] != 'a') {
a[i] += x[i][i2] - '0';
}
}
check = i;
}
for (int i = 0; i <= check; i++) {
cout << a[i] << endl;
}
return 0;
} | replace | 3 | 6 | 3 | 6 | 0 | |
p02416 | C++ | Time Limit Exceeded | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
char x[1000];
while (1) {
scanf("%s", x);
if (x[0] == 0)
break;
int sum = 0;
for (int i = 0; i < strlen(x); i++) {
sum += (x[i] - '0');
}
printf("%d\n", sum);
}
return 0;
} | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
char x[1000];
while (1) {
scanf("%s", x);
if (x[0] == '0')
break;
int sum = 0;
for (int i = 0; i < strlen(x); i++) {
sum += (x[i] - '0');
}
printf("%d\n", sum);
}
return 0;
} | replace | 10 | 11 | 10 | 11 | TLE | |
p02416 | C++ | Time Limit Exceeded | // ITP1_8_B
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
int sum, i;
char c;
for (sum = 0;; sum = 0) {
for (i = 0;; i++) {
c = getchar();
if (c == '\n') {
cout << sum << endl;
break;
} else if (c == '0' && i == 0)
break;
sum += c - '0';
}
}
return 0;
} | // ITP1_8_B
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
int sum, i;
char c;
for (sum = 0;; sum = 0) {
for (i = 0;; i++) {
c = getchar();
if (c == '\n') {
cout << sum << endl;
break;
} else if (c == '0' && i == 0)
return 0;
sum += c - '0';
}
}
return 0;
} | replace | 16 | 17 | 16 | 17 | TLE | |
p02416 | C++ | Time Limit Exceeded | #include <stdio.h>
#include <string.h>
#define rep(i, a) for (int i = 0; i < a; ++i)
int main(void) {
char s[1500];
int i, ans = 0;
while (1) {
ans = 0;
scanf("%s", s);
if (strlen(s) == 1 && s[0] == 0)
break;
rep(i, strlen(s)) ans += s[i] - '0';
printf("%d\n", ans);
}
return 0;
}
| #include <stdio.h>
#include <string.h>
#define rep(i, a) for (int i = 0; i < a; ++i)
int main(void) {
char s[1500];
int i, ans = 0;
while (1) {
ans = 0;
scanf("%s", s);
if (strlen(s) == 1 && s[0] == '0')
break;
rep(i, strlen(s)) ans += s[i] - '0';
printf("%d\n", ans);
}
return 0;
}
| replace | 10 | 11 | 10 | 11 | TLE | |
p02416 | C++ | Runtime Error |
#include <cstdio>
int main() {
char num[900];
int sum, i, n;
for (;;) {
scanf("%s", num);
i = 0;
sum = 0;
while (num[i] != 0) {
sum = sum + (num[i] - '0');
i++;
}
if (sum == 0) {
break;
}
printf("%d\n", sum);
}
return 0;
}
|
#include <cstdio>
int main() {
char num[1000];
int sum, i, n;
for (;;) {
scanf("%s", num);
i = 0;
sum = 0;
while (num[i] != 0) {
sum = sum + (num[i] - '0');
i++;
}
if (sum == 0) {
break;
}
printf("%d\n", sum);
}
return 0;
}
| replace | 4 | 5 | 4 | 5 | 0 | |
p02416 | C++ | Time Limit Exceeded | #define _USE_MATH_DEFINES
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
int main() {
while (true) {
string x;
if (x == "0")
break;
int sum = 0;
for (int i = 0; i < x.size(); i++) {
sum += x[i] - '0';
}
cout << sum << endl;
}
return 0;
}
| #define _USE_MATH_DEFINES
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
int main() {
while (true) {
string x;
cin >> x;
if (x == "0")
break;
int sum = 0;
for (int i = 0; i < x.size(); i++) {
sum += x[i] - '0';
}
cout << sum << endl;
}
return 0;
}
| insert | 13 | 13 | 13 | 14 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
char SAO;
int count[26] = {0};
while (true) {
cin >> SAO;
if (SAO == '.')
break;
if (SAO == 'A' || SAO == 'a') {
count[0]++;
}
if (SAO == 'B' || SAO == 'b') {
count[1]++;
}
if (SAO == 'C' || SAO == 'c') {
count[2]++;
}
if (SAO == 'D' || SAO == 'd') {
count[3]++;
}
if (SAO == 'E' || SAO == 'e') {
count[4]++;
}
if (SAO == 'F' || SAO == 'f') {
count[5]++;
}
if (SAO == 'G' || SAO == 'g') {
count[6]++;
}
if (SAO == 'H' || SAO == 'h') {
count[7]++;
}
if (SAO == 'I' || SAO == 'i') {
count[8]++;
}
if (SAO == 'J' || SAO == 'j') {
count[9]++;
}
if (SAO == 'K' || SAO == 'k') {
count[10]++;
}
if (SAO == 'L' || SAO == 'l') {
count[11]++;
}
if (SAO == 'M' || SAO == 'm') {
count[12]++;
}
if (SAO == 'N' || SAO == 'n') {
count[13]++;
}
if (SAO == 'O' || SAO == 'o') {
count[14]++;
}
if (SAO == 'P' || SAO == 'p') {
count[15]++;
}
if (SAO == 'Q' || SAO == 'q') {
count[16]++;
}
if (SAO == 'R' || SAO == 'r') {
count[17]++;
}
if (SAO == 'S' || SAO == 's') {
count[18]++;
}
if (SAO == 'T' || SAO == 't') {
count[19]++;
}
if (SAO == 'U' || SAO == 'u') {
count[20]++;
}
if (SAO == 'V' || SAO == 'v') {
count[21]++;
}
if (SAO == 'W' || SAO == 'w') {
count[22]++;
}
if (SAO == 'X' || SAO == 'x') {
count[23]++;
}
if (SAO == 'Y' || SAO == 'y') {
count[24]++;
}
if (SAO == 'Z' || SAO == 'z') {
count[25]++;
}
}
cout << "a : " << count[0] << endl;
cout << "b : " << count[1] << endl;
cout << "c : " << count[2] << endl;
cout << "d : " << count[3] << endl;
cout << "e : " << count[4] << endl;
cout << "f : " << count[5] << endl;
cout << "g : " << count[6] << endl;
cout << "h : " << count[7] << endl;
cout << "i : " << count[8] << endl;
cout << "j : " << count[9] << endl;
cout << "k : " << count[10] << endl;
cout << "l : " << count[11] << endl;
cout << "m : " << count[12] << endl;
cout << "n : " << count[13] << endl;
cout << "o : " << count[14] << endl;
cout << "p : " << count[15] << endl;
cout << "q : " << count[16] << endl;
cout << "r : " << count[17] << endl;
cout << "s : " << count[18] << endl;
cout << "t : " << count[19] << endl;
cout << "u : " << count[20] << endl;
cout << "v : " << count[21] << endl;
cout << "w : " << count[22] << endl;
cout << "x : " << count[23] << endl;
cout << "y : " << count[24] << endl;
cout << "z : " << count[25] << endl;
} | #include <iostream>
using namespace std;
int main() {
char SAO;
int count[26] = {0};
while (cin >> SAO) {
if (isalpha(static_cast<unsigned char>(SAO))) {
if (SAO == 'A' || SAO == 'a') {
count[0]++;
}
if (SAO == 'B' || SAO == 'b') {
count[1]++;
}
if (SAO == 'C' || SAO == 'c') {
count[2]++;
}
if (SAO == 'D' || SAO == 'd') {
count[3]++;
}
if (SAO == 'E' || SAO == 'e') {
count[4]++;
}
if (SAO == 'F' || SAO == 'f') {
count[5]++;
}
if (SAO == 'G' || SAO == 'g') {
count[6]++;
}
if (SAO == 'H' || SAO == 'h') {
count[7]++;
}
if (SAO == 'I' || SAO == 'i') {
count[8]++;
}
if (SAO == 'J' || SAO == 'j') {
count[9]++;
}
if (SAO == 'K' || SAO == 'k') {
count[10]++;
}
if (SAO == 'L' || SAO == 'l') {
count[11]++;
}
if (SAO == 'M' || SAO == 'm') {
count[12]++;
}
if (SAO == 'N' || SAO == 'n') {
count[13]++;
}
if (SAO == 'O' || SAO == 'o') {
count[14]++;
}
if (SAO == 'P' || SAO == 'p') {
count[15]++;
}
if (SAO == 'Q' || SAO == 'q') {
count[16]++;
}
if (SAO == 'R' || SAO == 'r') {
count[17]++;
}
if (SAO == 'S' || SAO == 's') {
count[18]++;
}
if (SAO == 'T' || SAO == 't') {
count[19]++;
}
if (SAO == 'U' || SAO == 'u') {
count[20]++;
}
if (SAO == 'V' || SAO == 'v') {
count[21]++;
}
if (SAO == 'W' || SAO == 'w') {
count[22]++;
}
if (SAO == 'X' || SAO == 'x') {
count[23]++;
}
if (SAO == 'Y' || SAO == 'y') {
count[24]++;
}
if (SAO == 'Z' || SAO == 'z') {
count[25]++;
}
}
}
cout << "a : " << count[0] << endl;
cout << "b : " << count[1] << endl;
cout << "c : " << count[2] << endl;
cout << "d : " << count[3] << endl;
cout << "e : " << count[4] << endl;
cout << "f : " << count[5] << endl;
cout << "g : " << count[6] << endl;
cout << "h : " << count[7] << endl;
cout << "i : " << count[8] << endl;
cout << "j : " << count[9] << endl;
cout << "k : " << count[10] << endl;
cout << "l : " << count[11] << endl;
cout << "m : " << count[12] << endl;
cout << "n : " << count[13] << endl;
cout << "o : " << count[14] << endl;
cout << "p : " << count[15] << endl;
cout << "q : " << count[16] << endl;
cout << "r : " << count[17] << endl;
cout << "s : " << count[18] << endl;
cout << "t : " << count[19] << endl;
cout << "u : " << count[20] << endl;
cout << "v : " << count[21] << endl;
cout << "w : " << count[22] << endl;
cout << "x : " << count[23] << endl;
cout << "y : " << count[24] << endl;
cout << "z : " << count[25] << endl;
} | replace | 5 | 86 | 5 | 85 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <iostream>
#include <string>
#include <vector>
#define ALPHABET_NUM ('z' - 'a' + 1)
using namespace std;
int main(int argc, char *argv[]) {
vector<int> num(ALPHABET_NUM, 0);
while (true) {
string str;
getline(cin, str);
for (string::iterator itr = str.begin(); itr != str.end(); itr++) {
char c = *itr;
if (!('A' <= c && c <= 'Z') && !('a' <= c && c <= 'z'))
continue;
if ('A' <= c && c <= 'Z')
c += 'a' - 'A';
num[c - 'a']++;
}
}
for (int i = 0; i < num.size(); i++) {
cout << (char)('a' + i) << " : " << num[i] << endl;
}
return 0;
} | #include <iostream>
#include <string>
#include <vector>
#define ALPHABET_NUM ('z' - 'a' + 1)
using namespace std;
int main(int argc, char *argv[]) {
vector<int> num(ALPHABET_NUM, 0);
char c;
while (cin >> c) {
if (!('A' <= c && c <= 'Z') && !('a' <= c && c <= 'z'))
continue;
if ('A' <= c && c <= 'Z')
c += 'a' - 'A';
num[c - 'a']++;
}
for (int i = 0; i < num.size(); i++) {
cout << (char)('a' + i) << " : " << num[i] << endl;
}
return 0;
} | replace | 10 | 21 | 10 | 17 | TLE | |
p02417 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
int cnt[25] = {};
char ch;
while (cin >> ch) {
ch = tolower(ch);
if (isalpha(ch))
cnt[ch - 'a']++;
}
for (int i = 0; i <= 25; i++) {
cout << (char)(i + 'a') << " : " << cnt[i] << endl;
}
return 0;
}
| #include <iostream>
#include <string>
using namespace std;
int main() {
int cnt[26] = {};
char ch;
while (cin >> ch) {
ch = tolower(ch);
if (isalpha(ch))
cnt[ch - 'a']++;
}
for (int i = 0; i <= 25; i++) {
cout << (char)(i + 'a') << " : " << cnt[i] << endl;
}
return 0;
}
| replace | 5 | 6 | 5 | 6 | 0 | |
p02417 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
string a, e;
int i, d[26];
for (i = 0; i < 26; i++) {
d[i] = 0;
}
char b;
while (1) {
getline(cin, e);
a += e;
if (e.substr(1, 1) == "") {
break;
}
}
string::iterator s;
for (s = a.begin(); s != a.end(); s++) {
*s = tolower(*s);
}
for (i = 0; i < 26; i++) {
for (s = a.begin(); s != a.end(); s++) {
b = 97 + i;
if (*s == b) {
d[i] += 1;
}
}
}
for (i = 0; i < 26; i++) {
b = 97 + i;
cout << b << " : " << d[i] << endl;
}
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string a, e;
int i, d[26];
for (i = 0; i < 26; i++) {
d[i] = 0;
}
char b;
while (1) {
getline(cin, e);
a += e;
if (e == "") {
break;
}
}
string::iterator s;
for (s = a.begin(); s != a.end(); s++) {
*s = tolower(*s);
}
for (i = 0; i < 26; i++) {
for (s = a.begin(); s != a.end(); s++) {
b = 97 + i;
if (*s == b) {
d[i] += 1;
}
}
}
for (i = 0; i < 26; i++) {
b = 97 + i;
cout << b << " : " << d[i] << endl;
}
return 0;
} | replace | 15 | 16 | 15 | 16 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr: __pos (which is 1) > this->size() (which is 0)
|
p02417 | C++ | Time Limit Exceeded | #include <ctype.h>
#include <stdio.h>
int main() {
int c;
int cnt[500] = {0};
while (c != '.') {
c = getchar();
if (islower(c)) {
cnt[c]++;
} else {
cnt[c + 32]++;
}
}
for (c = 'a'; c <= 'z'; c++) {
printf("%c : %d\n", c, cnt[c]);
}
return 0;
} | #include <ctype.h>
#include <stdio.h>
int main() {
int c;
int cnt[500] = {0};
while (c != EOF) {
c = getchar();
if (islower(c)) {
cnt[c]++;
} else {
cnt[c + 32]++;
}
}
for (c = 'a'; c <= 'z'; c++) {
printf("%c : %d\n", c, cnt[c]);
}
return 0;
} | replace | 5 | 6 | 5 | 6 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <iostream>
int main() {
char c;
int n[26]{};
while (1) {
std::cin >> c;
if (c == '0')
break;
if ('A' <= c && c <= 'Z')
++n[c - 'A'];
else if ('a' <= c && c <= 'z')
++n[c - 'a'];
}
for (int i = 0; i != 26; ++i)
std::cout << char('a' + i) << " : " << n[i] << '\n';
} | #include <iostream>
int main() {
char c;
int n[26]{};
while (std::cin >> c) {
if ('A' <= c && c <= 'Z')
++n[c - 'A'];
else if ('a' <= c && c <= 'z')
++n[c - 'a'];
}
for (int i = 0; i != 26; ++i)
std::cout << char('a' + i) << " : " << n[i] << '\n';
} | replace | 5 | 9 | 5 | 6 | TLE | |
p02417 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main(void) {
// Your code here! sakuraihaaho
string x;
int hai[26] = {};
while (getline(cin, x)) {
for (int i = 0; i < x.size(); i++) {
if ((int)x.at(i) >= (int)'a' && (int)x.at(i) <= (int)'z')
hai[x.at(i) - (int)'a'] += 1;
else
hai[x.at(i) - (int)'A'] += 1;
}
}
for (int i = 0; i < 26; i++) {
cout << (char)('a' + i) << " : " << hai[i] << endl;
}
return 0;
}
| #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main(void) {
// Your code here! sakuraihaaho
string x;
int hai[26] = {};
while (getline(cin, x)) {
for (int i = 0; i < x.size(); i++) {
if ((int)x.at(i) >= (int)'a' && (int)x.at(i) <= (int)'z')
hai[x.at(i) - (int)'a'] += 1;
else if ((int)x.at(i) >= (int)'A' && (int)x.at(i) <= (int)'Z')
hai[x.at(i) - (int)'A'] += 1;
}
}
for (int i = 0; i < 26; i++) {
cout << (char)('a' + i) << " : " << hai[i] << endl;
}
return 0;
}
| replace | 11 | 12 | 11 | 12 | 0 | |
p02417 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
// map < char , int > count;
int count[500] = {};
string str;
while (cin >> str) {
for (int i = 0; i < str.size(); i++) {
if (isupper(str[i]))
str[i] = tolower(str[i]);
}
for (int i = 0; i < str.size(); i++) {
count[str[i]]++;
}
}
for (char ch = 'a'; ch = 'z'; ch++) {
cout << ch << " : " << count[ch] << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
// map < char , int > count;
int count[500] = {};
string str;
while (cin >> str) {
for (int i = 0; i < str.size(); i++) {
if (isupper(str[i]))
str[i] = tolower(str[i]);
}
for (int i = 0; i < str.size(); i++) {
count[str[i]]++;
}
}
for (char ch = 'a'; ch <= 'z'; ch++) {
cout << ch << " : " << count[ch] << endl;
}
return 0;
}
| replace | 16 | 17 | 16 | 17 | TLE | |
p02417 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <locale>
#include <string>
#include <vector>
static bool readLines(std::string &str) {
std::string tmp;
if (0x00 == &str) {
return false;
}
while (std::getline(std::cin, tmp)) {
if (0 < tmp.size()) {
transform(str.begin(), str.end(), str.begin(), tolower);
str += tmp;
}
}
return true;
}
static bool countAlpha(const std::string &str, std::vector<int> &v) {
if (0x00 == &str || 0x00 == &v) {
return false;
}
if (0 >= v.size()) {
v.resize(26);
for (unsigned int i = 0; i < v.size(); i++) {
v.at(i) = 0;
}
}
char ch;
int index = 0;
for (unsigned int i = 0; i < str.size(); i++) {
ch = str.at(i);
if (false == std::isalpha(ch))
continue;
index = static_cast<int>(ch - 'a');
v.at(index)++;
}
return true;
}
int main() {
std::string alpha("abcdefghijklmnopqrstuvwxyz");
std::string str;
std::vector<int> vec(26);
for (unsigned int i = 0; i < vec.size(); i++) {
vec.at(i) = 0;
}
if (true == readLines(str)) {
countAlpha(str, vec);
for (unsigned int i = 0; i < vec.size(); i++) {
std::cout << alpha.at(i) << " : " << vec.at(i) << std::endl;
}
}
return (0);
} | #include <algorithm>
#include <iostream>
#include <locale>
#include <string>
#include <vector>
static bool readLines(std::string &str) {
std::string tmp;
if (0x00 == &str) {
return false;
}
while (std::getline(std::cin, tmp)) {
if (0 < tmp.size()) {
transform(tmp.begin(), tmp.end(), tmp.begin(), tolower);
str += tmp;
}
}
return true;
}
static bool countAlpha(const std::string &str, std::vector<int> &v) {
if (0x00 == &str || 0x00 == &v) {
return false;
}
if (0 >= v.size()) {
v.resize(26);
for (unsigned int i = 0; i < v.size(); i++) {
v.at(i) = 0;
}
}
char ch;
int index = 0;
for (unsigned int i = 0; i < str.size(); i++) {
ch = str.at(i);
if (false == std::isalpha(ch))
continue;
index = static_cast<int>(ch - 'a');
v.at(index)++;
}
return true;
}
int main() {
std::string alpha("abcdefghijklmnopqrstuvwxyz");
std::string str;
std::vector<int> vec(26);
for (unsigned int i = 0; i < vec.size(); i++) {
vec.at(i) = 0;
}
if (true == readLines(str)) {
countAlpha(str, vec);
for (unsigned int i = 0; i < vec.size(); i++) {
std::cout << alpha.at(i) << " : " << vec.at(i) << std::endl;
}
}
return (0);
} | replace | 15 | 16 | 15 | 16 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 18446744073709551603) >= this->size() (which is 26)
|
p02417 | C++ | Time Limit Exceeded | #include <cstdio>
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
char ch, x;
int ans, num, counter[100] = {}, i, j;
while (1) {
cin >> ch;
if (ch == EOF)
break;
else if (ch > 'A' && ch < 'Z') {
ch += 'a' - 'A';
}
num = ch - 'a';
counter[num]++;
}
for (i = 0; i < 26; i++) {
x = i + 'a';
ans = counter[i];
cout << x << " : " << ans << endl;
}
return 0;
} | #include <cstdio>
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
char ch, x;
int ans, num, counter[100] = {}, i, j;
while (cin >> ch) {
if (ch >= 'A' && ch <= 'Z') {
ch += 'a' - 'A';
}
num = ch - 'a';
counter[num]++;
}
for (i = 0; i < 26; i++) {
x = i + 'a';
ans = counter[i];
cout << x << " : " << ans << endl;
}
return 0;
} | replace | 7 | 12 | 7 | 9 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <cctype>
#include <cstdio>
int main() {
int n[26] = {0};
char c;
while (scanf("%c", &c), c != EOF)
n[(int)tolower(c) - 97]++;
c = 97;
for (int i = 0; i < 26; i++)
printf("%c : %d\n", c + i, n[i]);
} | #include <cctype>
#include <cstdio>
int main() {
int n[26] = {0};
char c;
while (scanf("%c", &c) != EOF)
n[(int)tolower(c) - 97]++;
c = 97;
for (int i = 0; i < 26; i++)
printf("%c : %d\n", c + i, n[i]);
} | replace | 5 | 6 | 5 | 6 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <stdio.h>
int main() {
char ch[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
int cnt[26] = {0};
char inp;
while (1) {
scanf("%c", &inp);
if (inp == EOF)
break;
for (int i = 0; i < 26; i++) {
if (inp == ch[i] || inp == ch[i] - 32) {
cnt[i]++;
break;
}
}
}
for (int j = 0; j < 26; j++) {
printf("%c : %d\n", ch[j], cnt[j]);
}
return 0;
}
| #include <stdio.h>
int main() {
char ch[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
int cnt[26] = {0};
char inp;
while (1) {
if (scanf("%c", &inp) == EOF)
break;
for (int i = 0; i < 26; i++) {
if (inp == ch[i] || inp == ch[i] - 32) {
cnt[i]++;
break;
}
}
}
for (int j = 0; j < 26; j++) {
printf("%c : %d\n", ch[j], cnt[j]);
}
return 0;
}
| replace | 10 | 12 | 10 | 11 | TLE | |
p02417 | C++ | Runtime Error |
#include <cstdio>
int main() {
int count[26];
for (int i = 0; i < 1201; i++) {
count[i] = 0;
}
char ch;
while (scanf("%c", &ch) != EOF) {
if (ch >= 'a' && ch <= 'z') {
count[ch - 'a']++;
} else if (ch >= 'A' && ch <= 'Z') {
count[ch - 'A']++;
}
}
for (int j = 0; j < 26; j++) {
printf("%c : %d\n", j + 'a', count[j]);
}
return 0;
}
|
#include <cstdio>
int main() {
int count[1201];
char ch;
while (scanf("%c", &ch) != EOF) {
if (ch >= 'a' && ch <= 'z') {
count[ch - 'a']++;
} else if (ch >= 'A' && ch <= 'Z') {
count[ch - 'A']++;
}
}
for (int j = 0; j < 26; j++) {
printf("%c : %d\n", j + 'a', count[j]);
}
return 0;
}
| replace | 4 | 8 | 4 | 5 | -6 | *** stack smashing detected ***: terminated
|
p02417 | C++ | Time Limit Exceeded | #include <ctype.h>
#include <stdio.h>
#define CHARNUM 26
char c_set[CHARNUM] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
int ctoi(char c) {
int i = 0;
while (c != c_set[i] && i < CHARNUM) {
i++;
}
return i;
}
int main() {
char c;
int v[CHARNUM + 1] = {0};
while ((c = getchar()) != '\n') {
ungetc(c, stdin);
while (1) {
c = tolower(getchar());
if (c == '\n')
break;
v[ctoi(c)]++;
}
}
for (int i = 0; i < CHARNUM; i++) {
printf("%c : %d\n", c_set[i], v[i]);
}
} | #include <ctype.h>
#include <stdio.h>
#define CHARNUM 26
char c_set[CHARNUM] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
int ctoi(char c) {
int i = 0;
while (c != c_set[i] && i < CHARNUM) {
i++;
}
return i;
}
int main() {
char c;
int v[CHARNUM + 1] = {0};
while ((c = getchar()) != EOF) {
ungetc(c, stdin);
while (1) {
c = tolower(getchar());
if (c == '\n')
break;
v[ctoi(c)]++;
}
}
for (int i = 0; i < CHARNUM; i++) {
printf("%c : %d\n", c_set[i], v[i]);
}
} | replace | 19 | 20 | 19 | 20 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int a[26] = {}, i;
char c;
while (1) {
cin.get(c);
if (c == 'EOF')
break;
else if ('a' <= c && c <= 'z')
a[c - 'a']++;
else if ('A' <= c && c <= 'Z')
a[c - 'A']++;
}
for (i = 0; i < 26; i++) {
c = 'a' + i;
cout << c << " : " << a[i] << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
int a[26] = {}, i;
char c;
while (cin.get(c)) {
if (c == 'EOF')
break;
else if ('a' <= c && c <= 'z')
a[c - 'a']++;
else if ('A' <= c && c <= 'Z')
a[c - 'A']++;
}
for (i = 0; i < 26; i++) {
c = 'a' + i;
cout << c << " : " << a[i] << endl;
}
return 0;
} | replace | 6 | 8 | 6 | 7 | TLE | |
p02417 | C++ | Runtime Error | #include <cctype>
#include <iostream>
#include <string>
using namespace std;
int main(void) {
int counter[26];
string ch;
char c;
for (c = 'a'; c <= 'z'; c++) {
counter[c] = 0;
}
while (cin >> ch) {
for (int i = 0; i < (int)ch.size(); i++) {
if (isupper(ch[i]))
ch[i] = tolower(ch[i]);
counter[ch[i]]++;
}
}
for (c = 'a'; c <= 'z'; c++) {
cout << c << " : " << counter[c] << endl;
}
return 0;
}
| #include <cctype>
#include <iostream>
#include <string>
using namespace std;
int main(void) {
int counter[256];
string ch;
char c;
for (c = 'a'; c <= 'z'; c++) {
counter[c] = 0;
}
while (cin >> ch) {
for (int i = 0; i < (int)ch.size(); i++) {
if (isupper(ch[i]))
ch[i] = tolower(ch[i]);
counter[ch[i]]++;
}
}
for (c = 'a'; c <= 'z'; c++) {
cout << c << " : " << counter[c] << endl;
}
return 0;
}
| replace | 7 | 8 | 7 | 8 | 0 | |
p02417 | C++ | Runtime Error |
#include <cstdio>
int main() {
int count[26];
for (int i = 0; i < 1201; i++) {
count[i] = 0;
}
char ch;
while (scanf("%c", &ch) != EOF) {
if (ch >= 'a' && ch <= 'z') {
count[ch - 'a']++;
} else if (ch >= 'A' && ch <= 'Z') {
count[ch - 'A']++;
}
}
for (int j = 0; j < 26; j++) {
printf("%c : %d\n", j + 'a', count[j]);
}
return 0;
}
|
#include <cstdio>
int main() {
int count[1201];
char ch;
while (scanf("%c", &ch) != EOF) {
if (ch >= 'a' && ch <= 'z') {
count[ch - 'a']++;
} else if (ch >= 'A' && ch <= 'Z') {
count[ch - 'A']++;
}
}
for (int j = 0; j < 26; j++) {
printf("%c : %d\n", j + 'a', count[j]);
}
return 0;
}
| replace | 4 | 8 | 4 | 5 | -11 | |
p02417 | C++ | Time Limit Exceeded | #include <cctype>
#include <stdio.h>
int main() {
char ch;
int count[26] = {};
while ((ch = getchar()) != '\0') {
if (isupper(ch))
ch = tolower(ch);
if (isalpha(ch))
count[ch - 'a'] += 1;
}
for (int i = 0; i < 26; i++) {
printf("%c : %d\n", i + 'a', count[i]);
}
}
| #include <cctype>
#include <stdio.h>
int main() {
char ch;
int count[26] = {};
while ((ch = getchar()) != EOF) {
if (isupper(ch))
ch = tolower(ch);
if (isalpha(ch))
count[ch - 'a'] += 1;
}
for (int i = 0; i < 26; i++) {
printf("%c : %d\n", i + 'a', count[i]);
}
}
| replace | 5 | 6 | 5 | 6 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
char c;
int a[26] = {0};
char d[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
int b, i;
while (scanf("%c", &c) && c != EOF) {
if (c >= 'a' && c <= 'z') {
b = c - 'a';
a[b]++;
} else if (c >= 'A' && c <= 'Z') {
b = c - 'A';
a[b]++;
}
}
for (i = 0; i < 26; i++) {
cout << d[i] << " : " << a[i] << endl;
}
} | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
char c;
int a[26] = {0};
char d[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
int b, i;
while (scanf("%c", &c) != EOF) {
if (c >= 'a' && c <= 'z') {
b = c - 'a';
a[b]++;
} else if (c >= 'A' && c <= 'Z') {
b = c - 'A';
a[b]++;
}
}
for (i = 0; i < 26; i++) {
cout << d[i] << " : " << a[i] << endl;
}
} | replace | 11 | 12 | 11 | 12 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
unordered_multiset<string> parts;
vector<string> alphabet;
for (int i = 97; i < 123; i++) {
alphabet.push_back(string(1, (char)i));
}
while (1) {
string word;
cin >> word;
for (auto var : word) {
parts.insert(string(1, tolower(var)));
}
if (*(word.end() - 1) == '.')
break;
}
for (auto var : alphabet) {
cout << var << " : " << parts.count(var) << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
unordered_multiset<string> parts;
vector<string> alphabet;
for (int i = 97; i < 123; i++) {
alphabet.push_back(string(1, (char)i));
}
char tmpc;
while (cin >> tmpc) {
parts.insert(string(1, tolower(tmpc)));
}
for (auto var : alphabet) {
cout << var << " : " << parts.count(var) << endl;
}
return 0;
}
| replace | 8 | 16 | 8 | 12 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> Result(26, 0);
char a;
while (scanf("%c", &a)) {
if (a == EOF) {
break;
}
if (iswalpha(a)) {
int temp = tolower(a) - 'a';
Result.at(temp) += 1;
}
}
char c = 'a';
for (auto b : Result) {
cout << c << " : " << b << endl;
c++;
}
} | #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> Result(26, 0);
char a;
while (cin >> a) {
if (iswalpha(a)) {
int temp = tolower(a) - 'a';
Result.at(temp) += 1;
}
}
char c = 'a';
for (auto b : Result) {
cout << c << " : " << b << endl;
c++;
}
} | replace | 10 | 14 | 10 | 11 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
char a;
int kotae[26], b;
int main(void) {
while (1) {
scanf(" %c", &a);
if (a == '.')
break;
for (int j = 0; j < 26; j++) {
if (a == 'a' + j || a == 'A' + j) {
kotae[j] += 1;
}
}
}
for (int i = 0; i < 26; i++) {
cout << (char)('a' + i) << " : " << kotae[i] << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
char a;
int kotae[26], b;
int main(void) {
while (1) {
if (scanf(" %c", &a) == EOF)
break;
for (int j = 0; j < 26; j++) {
if (a == 'a' + j || a == 'A' + j) {
kotae[j] += 1;
}
}
}
for (int i = 0; i < 26; i++) {
cout << (char)('a' + i) << " : " << kotae[i] << endl;
}
}
| replace | 6 | 8 | 6 | 7 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int alpha[26];
for (int a = 0; a < 26; a++)
alpha[a] = 0;
char ch;
while (1) {
cin >> ch;
if (ch == '.')
break;
for (int i = 0; i < 26; i++) {
if (ch - 'a' == i)
alpha[i]++;
else if (ch + 32 - 'a' == i)
alpha[i]++;
}
}
for (int i = 0; i < 26; i++) {
cout << (char)(i + 'a') << " : " << alpha[i] << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int alpha[26];
for (int a = 0; a < 26; a++)
alpha[a] = 0;
char ch;
while (cin >> ch) {
for (int i = 0; i < 26; i++) {
if (ch - 'a' == i)
alpha[i]++;
else if (ch + 32 - 'a' == i)
alpha[i]++;
}
}
for (int i = 0; i < 26; i++) {
cout << (char)(i + 'a') << " : " << alpha[i] << endl;
}
return 0;
}
| replace | 9 | 13 | 9 | 10 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <ctype.h>
#include <stdio.h>
int main() {
int s;
int i = 0;
int count[26] = {0};
while ((s = getchar()) != '.' || i < 20) {
s = tolower(s);
if (s >= 'a' && s <= 'z')
count[s - 'a']++;
i++;
}
for (i = 0; i < 26; i++)
printf("%c : %d\n", 97 + i, count[i]);
return 0;
} | #include <ctype.h>
#include <stdio.h>
int main() {
int s;
int i = 0;
int count[26] = {0};
while (i < 1200) {
s = getchar();
s = tolower(s);
if (s >= 'a' && s <= 'z')
count[s - 'a']++;
i++;
}
for (i = 0; i < 26; i++)
printf("%c : %d\n", 97 + i, count[i]);
return 0;
} | replace | 6 | 7 | 6 | 8 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <cstdio>
int main(void) {
int ch;
int chCounts[26] = {};
while (scanf("%d", &ch) != EOF) {
if ('a' <= ch && ch <= 'z') {
chCounts[ch - 'a']++;
} else if ('A' <= ch && ch <= 'Z') {
chCounts[ch - 'A']++;
}
}
for (int i = 0; i < 26; i++) {
printf("%c : %d\n", 'a' + i, chCounts[i]);
}
return 0;
} | #include <cstdio>
int main(void) {
int ch;
int chCounts[26] = {};
while ((ch = getchar()) != EOF) {
if ('a' <= ch && ch <= 'z') {
chCounts[ch - 'a']++;
} else if ('A' <= ch && ch <= 'Z') {
chCounts[ch - 'A']++;
}
}
for (int i = 0; i < 26; i++) {
printf("%c : %d\n", 'a' + i, chCounts[i]);
}
return 0;
} | replace | 5 | 6 | 5 | 6 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <ctype.h>
#include <stdio.h>
int main(void) {
char str;
static int cnt[26];
int ptr;
while (true) {
scanf("%c", &str);
if (str == EOF)
break;
if (isalpha(str)) {
if (isupper(str))
ptr = str - 'A';
else
ptr = str - 'a';
cnt[ptr]++;
}
}
for (int i = 0; i < 26; i++) {
printf("%c : %d\n", 'a' + i, cnt[i]);
}
return 0;
} | #include <ctype.h>
#include <stdio.h>
int main(void) {
char str;
static int cnt[26];
int ptr;
while (scanf("%c", &str) != EOF) {
if (isalpha(str)) {
if (isupper(str))
ptr = str - 'A';
else
ptr = str - 'a';
cnt[ptr]++;
}
}
for (int i = 0; i < 26; i++) {
printf("%c : %d\n", 'a' + i, cnt[i]);
}
return 0;
} | replace | 8 | 12 | 8 | 9 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <cctype>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
char moji;
int alpha[26] = {0};
while ((moji = getchar()) != 0) {
moji = tolower(moji);
alpha[moji - 'a']++;
}
for (int i = 0; i < 26; i++) {
printf("%c : %d\n", 97 + i, alpha[i]);
}
return 0;
}
| #include <cctype>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
char moji;
int alpha[26] = {0};
while ((moji = getchar()) != EOF) {
moji = tolower(moji);
alpha[moji - 'a']++;
}
for (int i = 0; i < 26; i++) {
printf("%c : %d\n", 97 + i, alpha[i]);
}
return 0;
}
| replace | 10 | 11 | 10 | 11 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main(void) {
int a[26] = {0};
char text;
while (true) {
cin >> text;
if (text >= 'a' && text <= 'z')
a[text - 'a']++;
if (text >= 'A' && text <= 'Z')
a[text - 'A']++;
}
for (int i = 0; i < 26; i++) {
cout << (char)(i + 'a') << " : " << a[i] << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main(void) {
int a[26] = {0};
char text;
while (cin >> text) {
if (text >= 'a' && text <= 'z')
a[text - 'a']++;
if (text >= 'A' && text <= 'Z')
a[text - 'A']++;
}
for (int i = 0; i < 26; i++) {
cout << (char)(i + 'a') << " : " << a[i] << endl;
}
return 0;
} | replace | 6 | 8 | 6 | 7 | TLE | |
p02417 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string ch;
int result[25] = {0};
cin >> ch;
for (int i = 0; i < ch.size(); i++) {
if (isalpha(ch[i])) {
result[ch[i] - 'a']++;
}
}
for (int i = 0; i < 26; i++) {
cout << (char)('a' + i) << " : " << result[i] << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string ch;
int result[26] = {0};
while (getline(cin, ch)) {
for (int i = 0; i < ch.size(); i++) {
if (isalpha(ch[i])) {
ch[i] = tolower(ch[i]);
result[ch[i] - 'a']++;
}
}
}
for (int i = 0; i < 26; i++) {
cout << (char)('a' + i) << " : " << result[i] << endl;
}
}
| replace | 4 | 9 | 4 | 11 | 0 | |
p02417 | C++ | Time Limit Exceeded | #include <cctype>
#include <iostream>
using namespace std;
int main() {
char ch;
int count[26] = {0};
int i;
while (1) {
cin >> ch;
if (isalpha(ch) != 0) {
count[tolower(ch) - 'a']++;
}
}
for (i = 0; i < 26; i++) {
cout << (char)(i + 'a') << " : " << count[i] << endl;
}
return 0;
} | #include <cctype>
#include <iostream>
using namespace std;
int main() {
char ch;
int count[26] = {0};
int i;
while (cin >> ch) {
if (isalpha(ch) != 0) {
count[tolower(ch) - 'a']++;
}
}
for (i = 0; i < 26; i++) {
cout << (char)(i + 'a') << " : " << count[i] << endl;
}
return 0;
} | replace | 9 | 11 | 9 | 10 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <math.h>
#include <stdio.h>
#include <string.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
int main() {
char c;
int d[26] = {0};
while (scanf("%c", &c) != 'EOF') {
// if(c=='0') break;
if ('a' <= c && c <= 'z')
d[c - 'a']++;
else if ('A' <= c && c <= 'Z')
d[c - 'A']++;
}
rep(i, 0, 26) { printf("%c : %d\n", 'a' + i, d[i]); }
return 0;
} | #include <math.h>
#include <stdio.h>
#include <string.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
int main() {
char c;
int d[26] = {0};
while (scanf("%c", &c) != EOF) {
// if(c=='0') break;
if ('a' <= c && c <= 'z')
d[c - 'a']++;
else if ('A' <= c && c <= 'Z')
d[c - 'A']++;
}
rep(i, 0, 26) { printf("%c : %d\n", 'a' + i, d[i]); }
return 0;
} | replace | 8 | 9 | 8 | 9 | TLE | |
p02417 | C++ | Time Limit Exceeded | #include <cctype>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
char ch;
int count[26] = {};
while (1) {
cin >> ch;
ch = tolower(ch);
if (isalpha(ch)) {
count[ch - 'a']++;
}
}
for (int i = 0; i < 26; i++) {
printf("%c : %d\n", i + 'a', count[i]);
}
}
| #include <cctype>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
char ch;
int count[26] = {};
while (cin >> ch) {
ch = tolower(ch);
if (isalpha(ch)) {
count[ch - 'a']++;
}
}
for (int i = 0; i < 26; i++) {
printf("%c : %d\n", i + 'a', count[i]);
}
}
| replace | 7 | 9 | 7 | 8 | TLE | |
p02417 | C++ | Runtime Error | #include <algorithm>
#include <functional>
#include <iostream>
#include <vector>
using namespace std;
int main() {
string s;
char m;
vector<char> si;
getline(cin, s);
while (s.size() > 0) {
// si.resize(s.size());
// for(int i=0;i<s.size();i++){
// si[i] = null;
// }
int i = 0;
while (s[i] != '\0') {
m = tolower(s[i]);
if (m >= 'a' && m <= 'z') {
si.push_back(m);
}
i++;
}
getline(cin, s);
}
sort(si.begin(), si.end());
// for(int i=0;i<=si.size();i++){
// cout << si[i];
// }
char moji = 'a';
int spos = 0;
int cnt = 0;
while (moji <= 'z') {
if (moji == si[spos]) {
cnt++;
spos++;
} else {
cout << moji << " : " << cnt << endl;
moji = char(int(moji) + 1);
cnt = 0;
}
}
return 0;
}
| #include <algorithm>
#include <functional>
#include <iostream>
#include <vector>
using namespace std;
int main() {
string s;
char m;
vector<char> si;
getline(cin, s);
while (s.size() > 0) {
// si.resize(s.size());
// for(int i=0;i<s.size();i++){
// si[i] = null;
// }
int i = 0;
while (s[i] != '\0') {
m = tolower(s[i]);
if (m >= 'a' && m <= 'z') {
si.push_back(m);
}
i++;
}
getline(cin, s);
}
sort(si.begin(), si.end());
// for(int i=0;i<=si.size();i++){
// cout << si[i];
// }
char moji = 'a';
int spos = 0;
int cnt = 0;
while (moji <= 'z') {
if (spos < si.size() && moji == si[spos]) {
cnt++;
spos++;
} else {
cout << moji << " : " << cnt << endl;
moji = char(int(moji) + 1);
cnt = 0;
}
}
return 0;
}
| replace | 34 | 35 | 34 | 35 | 0 | |
p02417 | Python | Runtime Error | import sys
from collections import Counter
m = Counter(sys.stdin.read.lower())
for i in "abcdefghijklmnopqrstuvwxyz":
print(i, ":", m[i])
| import sys
from collections import Counter
m = Counter(sys.stdin.read().lower())
for i in "abcdefghijklmnopqrstuvwxyz":
print(i, ":", m[i])
| replace | 3 | 4 | 3 | 4 | AttributeError: 'builtin_function_or_method' object has no attribute 'lower' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02417/Python/s900646841.py", line 3, in <module>
m = Counter(sys.stdin.read.lower())
AttributeError: 'builtin_function_or_method' object has no attribute 'lower'
|
p02418 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
int main() {
string s, p;
cin >> s >> p;
int i, j, n, m;
n = s.length();
m = p.length();
for (i = 0; i < n; i = (i + 1) % n) {
for (j = 0; j < m; j++) {
if (s.at((i + j) % n) != p.at(j))
break;
if (j == m - 1)
j++;
}
if (j == m + 1) {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
| #include "bits/stdc++.h"
using namespace std;
int main() {
string s, p;
cin >> s >> p;
int i, j, n, m;
n = s.length();
m = p.length();
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
if (s.at((i + j) % n) != p.at(j))
break;
if (j == m - 1)
j++;
}
if (j == m + 1) {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
| replace | 8 | 9 | 8 | 9 | TLE | |
p02418 | C++ | Runtime Error | #include <cctype>
#include <cstring>
#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;
int main() {
char str1[100], str2[100], str3[100];
scanf("%s\n%s", str1, str2);
int length = strlen(str1);
strcpy(str3, str1);
strcat(str3, str1); // 文字列 str1 に文字列 str2 を連結する
if (strstr(str3, str2) == NULL)
printf("No\n");
else
printf("Yes\n");
return 0;
}
| #include <cctype>
#include <cstring>
#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;
int main() {
char str1[100], str2[100], str3[200];
scanf("%s\n%s", str1, str2);
int length = strlen(str1);
strcpy(str3, str1);
strcat(str3, str1); // 文字列 str1 に文字列 str2 を連結する
if (strstr(str3, str2) == NULL)
printf("No\n");
else
printf("Yes\n");
return 0;
}
| replace | 8 | 9 | 8 | 9 | 0 | |
p02418 | C++ | Time Limit Exceeded | #include <stdio.h>
// s: a raw text, p: a pattern text
// p in s ? true:false
char s[101];
char p[101];
int main() {
int i, n, j, flag, pflag;
scanf("%s", s);
scanf("%s", p);
for (i = 0; s[i] != '\0'; ++i) {
pflag = 0;
for (n = i, flag = 0; s[n == 0 ? 0 : n - 1] != '\0';) {
for (j = 0; p[j] != '\0' && pflag == 0; ++j) {
// printf("%d!!%d:%d, %c:%c\n",i, n, j, s[n], p[j]);
if (s[n] == '\0') {
// printf("loop%d:%d, %c:%c\n", n, j, s[n], p[j]);
if (flag != 0) {
pflag = 1;
}
flag++;
n = 0;
j--;
continue;
}
if (s[n++] != p[j])
break;
if (p[j + 1] == '\0') {
printf("Yes\n");
return 0;
}
}
if (j != 0) {
--n;
} else {
}
}
}
printf("No\n");
return 0;
}
| #include <stdio.h>
// s: a raw text, p: a pattern text
// p in s ? true:false
char s[101];
char p[101];
int main() {
int i, n, j, flag, pflag;
scanf("%s", s);
scanf("%s", p);
for (i = 0; s[i] != '\0'; ++i) {
pflag = 0;
for (n = i, flag = 0; s[n == 0 ? 0 : n - 1] != '\0' && pflag == 0;) {
for (j = 0; p[j] != '\0' && pflag == 0; ++j) {
// printf("%d!!%d:%d, %c:%c\n",i, n, j, s[n], p[j]);
if (s[n] == '\0') {
// printf("loop%d:%d, %c:%c\n", n, j, s[n], p[j]);
if (flag != 0) {
pflag = 1;
}
flag++;
n = 0;
j--;
continue;
}
if (s[n++] != p[j])
break;
if (p[j + 1] == '\0') {
printf("Yes\n");
return 0;
}
}
if (j != 0) {
--n;
} else {
}
}
}
printf("No\n");
return 0;
}
| replace | 11 | 12 | 11 | 12 | TLE | |
p02418 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
int main() {
char s[202], p[100];
scanf("%s", s);
scanf("%s", p);
strcat(s, s);
if (strstr(s, p)) {
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
} | #include <cstdio>
#include <cstring>
int main() {
char s[202], p[100];
scanf("%s", s);
scanf("%s", p);
sprintf(s, "%s%s", s, s);
if (strstr(s, p)) {
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
} | replace | 7 | 8 | 7 | 8 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.