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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02403 | C++ | Runtime Error | #include <stdio.h>
int main(void) {
int H, W, i, j;
while (1) {
scanf("%d %d\n", H, W);
if (H == 0 && W == 0) {
break;
}
for (i = 0; i < H; i++) {
for (j = 0; j < W; j++) {
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
}
| #include <stdio.h>
int main(void) {
int H, W, i, j;
while (1) {
scanf("%d %d", &H, &W);
if (H == 0 && W == 0) {
break;
}
for (i = 0; i < H; i++) {
for (j = 0; j < W; j++) {
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
}
| replace | 5 | 6 | 5 | 6 | -11 | |
p02403 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
while (1) {
int H, W;
cin >> H >> W;
if (H == 0 && W == 0)
break;
for (int i = 0; i = H; i++) {
for (int j = 0; j < W; j++) {
cout << "#";
}
cout << endl;
}
cout << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
while (1) {
int H, W;
cin >> H >> W;
if (H == 0 && W == 0)
break;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cout << "#";
}
cout << endl;
}
cout << endl;
}
return 0;
}
| replace | 10 | 11 | 10 | 11 | TLE | |
p02403 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
long long a[10005];
int main() {
int H, W, i, j;
cin >> H >> W;
i = 0;
j = 0;
while (H != 0 || W != 0) {
for (i = 0; i < H; i++) {
for (j = 0; j < W; j++) {
cout << "#";
}
cout << endl;
}
}
}
| #include <bits/stdc++.h>
#include <math.h>
using namespace std;
long long a[10005];
int main() {
int H, W, i = 0, j = 0;
bool b = false;
while (cin >> H >> W) {
if (H == 0 && W == 0) {
cout << endl;
break;
}
if (b == true)
cout << endl;
b = true;
for (i = 0; i < H; i++) {
for (j = 0; j < W; j++) {
cout << "#";
}
cout << endl;
}
}
}
| replace | 5 | 10 | 5 | 15 | TLE | |
p02403 | C++ | Runtime Error | #include <stdio.h>
int main() {
int i, j;
int h, w;
while (1) {
scanf("%d %d", h, w);
if (!(h || w))
break;
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++)
printf("#");
printf("\n");
}
printf("\n");
}
return 0;
} | #include <stdio.h>
int main() {
int i, j;
int h, w;
while (1) {
scanf("%d %d", &h, &w);
if (!(h || w))
break;
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++)
printf("#");
printf("\n");
}
printf("\n");
}
return 0;
} | replace | 7 | 8 | 7 | 8 | -11 | |
p02403 | C++ | Time Limit Exceeded | #include <iostream>
#include <math.h>
#include <stdio.h>
#define PI 3.1415926535897932384626433832795028841971
using namespace std;
int main() {
int w, h;
while (true) {
cin >> w >> h;
for (int hh = 0; hh < h; hh++) {
for (int ww = 0; ww < w; ww++) {
cout << '#';
}
cout << endl;
}
cout << endl;
}
return 0;
} | #include <iostream>
#include <math.h>
#include <stdio.h>
#define PI 3.1415926535897932384626433832795028841971
using namespace std;
int main() {
int w, h;
while (true) {
cin >> h >> w;
if (w == 0 && h == 0) {
break;
}
for (int hh = 0; hh < h; hh++) {
for (int ww = 0; ww < w; ww++) {
cout << '#';
}
cout << endl;
}
cout << endl;
}
return 0;
} | replace | 10 | 11 | 10 | 14 | TLE | |
p02403 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
typedef long long ll;
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
using namespace std;
int main() {
int H, W;
while (true) {
cin >> H >> W;
if ((H != 0) || (W != 0)) {
REP(i, H) {
REP(j, W) { cout << "#"; }
cout << endl;
}
cout << endl;
}
}
return 0;
}
| #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
typedef long long ll;
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
using namespace std;
int main() {
int H, W;
while (true) {
cin >> H >> W;
if ((H != 0) || (W != 0)) {
REP(i, H) {
REP(j, W) { cout << "#"; }
cout << endl;
}
cout << endl;
} else
break;
}
return 0;
}
| replace | 22 | 23 | 22 | 24 | TLE | |
p02403 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int H, W;
while (true) {
cin >> H >> W;
if (H == 0 && W == 0)
break;
for (int i = 0; i < H; ++i) {
for (int j = 0; i < W; ++j) {
cout << '#';
}
cout << endl;
}
cout << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int H, W;
while (true) {
cin >> H >> W;
if (H == 0 && W == 0)
break;
for (int i = 0; i < H; ++i) {
for (int j = 0; j < W; ++j) {
cout << '#';
}
cout << endl;
}
cout << endl;
}
return 0;
}
| replace | 11 | 12 | 11 | 12 | TLE | |
p02403 | C++ | Runtime Error | #include <stdio.h>
int main() {
int h, w;
while (scanf("%d %d", h, w) && (h != 0 || w != 0)) {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
}
| #include <stdio.h>
int main() {
int h, w;
while (scanf("%d %d", &h, &w) && (h != 0 || w != 0)) {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
}
| replace | 4 | 5 | 4 | 5 | -11 | |
p02403 | C++ | Time Limit Exceeded | #include <stdio.h>
int main(void) {
int x, y;
int i, j;
while (1) {
scanf("%d %d\n", &x, &y);
for (i = 0; i < x; i++) {
for (j = 0; j < y; j++) {
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
}
| #include <stdio.h>
int main(void) {
int x, y;
int i, j;
while (1) {
scanf("%d %d\n", &x, &y);
if (x == 0 && y == 0)
break;
for (i = 0; i < x; i++) {
for (j = 0; j < y; j++) {
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
}
| insert | 7 | 7 | 7 | 9 | TLE | |
p02403 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
while ((H != 0) || (W != 0)) {
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cout << "#";
}
cout << endl;
}
cout << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
while ((H != 0) || (W != 0)) {
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cout << "#";
}
cout << endl;
}
cout << endl;
cin >> H >> W;
}
return 0;
}
| insert | 14 | 14 | 14 | 15 | TLE | |
p02403 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int H, W;
while (1) {
cin >> H >> W;
if (H == 0 || W == 0) {
H = W = -1;
if (H == 0 && W == 0) {
break;
}
}
for (int i = 0; i < H; i++) {
for (int ii = 0; ii < W; ii++) {
cout << "#";
}
cout << endl;
}
cout << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
int H, W;
while (1) {
cin >> H >> W;
if (H == 0 && W == 0) {
break;
}
for (int i = 0; i < H; i++) {
for (int ii = 0; ii < W; ii++) {
cout << "#";
}
cout << endl;
}
cout << endl;
}
return 0;
} | replace | 6 | 11 | 6 | 9 | TLE | |
p02403 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
while (1) {
int H, W;
cin >> H >> W;
if (H == 0 && W == 0)
break;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; i++) {
cout << "#";
}
cout << endl;
}
cout << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
while (1) {
int H, W;
cin >> H >> W;
if (H == 0 && W == 0)
break;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cout << "#";
}
cout << endl;
}
cout << endl;
}
return 0;
}
| replace | 9 | 10 | 9 | 10 | TLE | |
p02403 | C++ | Time Limit Exceeded | #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int h, w, i, j;
for (;;) {
cin >> h >> w;
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
cout << "#";
}
cout << endl;
}
cout << endl;
}
return 0;
} | #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int h, w, i, j;
for (;;) {
cin >> h >> w;
if (h == 0 && w == 0) {
break;
}
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
cout << "#";
}
cout << endl;
}
cout << endl;
}
return 0;
} | insert | 7 | 7 | 7 | 10 | TLE | |
p02404 | C++ | Time Limit Exceeded | #include <cstdio>
#include <cstring>
int main() {
char ss[101];
int h, w, i, j;
while (true) {
scanf("%d %d", &h, &w);
if ((h == 0) && (w == 0))
break;
strcpy(ss, "#");
for (i = 0; i < w - 2; i++)
strcat(ss, ".");
strcat(ss, "#\n");
for (i = 0; i < w; i++)
printf("#");
printf("\n");
for (i = 0; i < h - 2; i++)
printf(ss);
for (i = 0; i < w; i++)
printf("#");
printf("\n\n");
}
return 0;
} | #include <cstdio>
#include <cstring>
int main() {
char ss[301];
int h, w, i, j;
while (true) {
scanf("%d %d", &h, &w);
if ((h == 0) && (w == 0))
break;
strcpy(ss, "#");
for (i = 0; i < w - 2; i++)
strcat(ss, ".");
strcat(ss, "#\n");
for (i = 0; i < w; i++)
printf("#");
printf("\n");
for (i = 0; i < h - 2; i++)
printf(ss);
for (i = 0; i < w; i++)
printf("#");
printf("\n\n");
}
return 0;
} | replace | 3 | 4 | 3 | 4 | TLE | |
p02404 | C++ | Time Limit Exceeded | #include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int main() {
std::ifstream in("input.txt");
std::cin.rdbuf(in.rdbuf());
int h, w;
while (true) {
cin >> h >> w;
if (h == 0 and w == 0) {
break;
}
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (i == 0 or i == h - 1) {
cout << "#";
} else if (j == 0 or j == w - 1) {
cout << "#";
} else {
cout << ".";
}
}
cout << endl;
}
cout << endl;
}
}
| #include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int main() {
int h, w;
while (true) {
cin >> h >> w;
if (h == 0 and w == 0) {
break;
}
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (i == 0 or i == h - 1) {
cout << "#";
} else if (j == 0 or j == w - 1) {
cout << "#";
} else {
cout << ".";
}
}
cout << endl;
}
cout << endl;
}
}
| delete | 11 | 13 | 11 | 11 | TLE | |
p02404 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int H, W;
while (1) {
cin >> H >> W;
for (int i = 0; i < W; i++)
cout << "#";
cout << endl;
for (int i = 1; i < H - 1; i++) {
cout << "#";
for (int i = 1; i < W - 1; i++)
cout << ".";
cout << "#" << endl;
}
for (int i = 0; i < W; i++)
cout << "#";
cout << endl << endl;
}
} | #include <iostream>
using namespace std;
int main() {
int H, W;
while (1) {
cin >> H >> W;
if (W == 0 && H == 0)
break;
for (int i = 0; i < W; i++)
cout << "#";
cout << endl;
for (int i = 1; i < H - 1; i++) {
cout << "#";
for (int i = 1; i < W - 1; i++)
cout << ".";
cout << "#" << endl;
}
for (int i = 0; i < W; i++)
cout << "#";
cout << endl << endl;
}
} | insert | 7 | 7 | 7 | 9 | TLE | |
p02404 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int a, b;
while (1) {
cin >> a >> b;
for (int i = 1; i <= a; i++) {
for (int j = 1; j <= b; j++) {
if (i == 1 || j == 1 || i == a || j == b) {
cout << "#";
} else {
cout << ".";
}
}
cout << endl;
}
cout << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
int a, b;
while (1) {
cin >> a >> b;
if (a == 0 && b == 0) {
break;
}
for (int i = 1; i <= a; i++) {
for (int j = 1; j <= b; j++) {
if (i == 1 || j == 1 || i == a || j == b) {
cout << "#";
} else {
cout << ".";
}
}
cout << endl;
}
cout << endl;
}
return 0;
} | insert | 7 | 7 | 7 | 10 | TLE | |
p02404 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
while (h || w) {
for (int i = 0; i < w; ++i) {
cout << "#";
}
cout << endl;
for (int i = 1; i < h - 1; ++i) {
cout << "#";
for (int j = 1; j < w - 1; ++j) {
cout << ".";
}
cout << "#" << endl;
}
for (int i = 0; i < w; ++i) {
cout << "#";
}
cout << endl << endl;
}
}
| #include <iostream>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
while (h || w) {
for (int i = 0; i < w; ++i) {
cout << "#";
}
cout << endl;
for (int i = 1; i < h - 1; ++i) {
cout << "#";
for (int j = 1; j < w - 1; ++j) {
cout << ".";
}
cout << "#" << endl;
}
for (int i = 0; i < w; ++i) {
cout << "#";
}
cout << endl << endl;
cin >> h >> w;
}
}
| insert | 23 | 23 | 23 | 24 | TLE | |
p02404 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int H, W;
int i, j;
while (1) {
char fig1[101] = {0};
char fig2[101] = {0};
cin >> H >> W;
if (H == 0 && W == 0)
break;
for (i = 0; i < W; i++) {
fig1[i] = '#';
}
fig2[0] = '#';
fig2[W - 1] = '#';
for (i = 1; i < W - 1; i++) {
fig2[i] = '.';
}
cout << fig1 << endl;
for (i = 0; i < H - 2; i++) {
cout << fig2 << endl;
}
cout << fig1 << endl;
cout << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
int H, W;
int i, j;
while (1) {
char fig1[301] = {0};
char fig2[301] = {0};
cin >> H >> W;
if (H == 0 && W == 0)
break;
for (i = 0; i < W; i++) {
fig1[i] = '#';
}
fig2[0] = '#';
fig2[W - 1] = '#';
for (i = 1; i < W - 1; i++) {
fig2[i] = '.';
}
cout << fig1 << endl;
for (i = 0; i < H - 2; i++) {
cout << fig2 << endl;
}
cout << fig1 << endl;
cout << endl;
}
return 0;
} | replace | 7 | 9 | 7 | 9 | TLE | |
p02404 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int h, w;
while (true) {
cin >> h >> w;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (i == 0 || i == h - 1)
cout << "#";
else {
if (j == 0 || j == w - 1)
cout << "#";
else
cout << ".";
}
}
cout << endl;
}
cout << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int h, w;
while (true) {
cin >> h >> w;
if (h == 0 && w == 0)
break;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (i == 0 || i == h - 1)
cout << "#";
else {
if (j == 0 || j == w - 1)
cout << "#";
else
cout << ".";
}
}
cout << endl;
}
cout << endl;
}
return 0;
}
| insert | 7 | 7 | 7 | 11 | TLE | |
p02404 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
int h, w;
cin >> h >> w;
for (int i = 0; i < w; i++)
cout << '#';
cout << endl;
for (int i = 2; i < h; i++) {
cout << '#';
for (int j = 2; j < w; j++)
cout << '.';
cout << '#' << endl;
}
for (int i = 0; i < w; i++)
cout << '#';
cout << endl;
cout << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
int h, w;
cin >> h >> w;
if (h == 0 && w == 0)
break;
for (int i = 0; i < w; i++)
cout << '#';
cout << endl;
for (int i = 2; i < h; i++) {
cout << '#';
for (int j = 2; j < w; j++)
cout << '.';
cout << '#' << endl;
}
for (int i = 0; i < w; i++)
cout << '#';
cout << endl;
cout << endl;
}
}
| insert | 6 | 6 | 6 | 8 | TLE | |
p02404 | C++ | Time Limit Exceeded | #include <stdio.h>
int main() {
int h, w;
while (scanf("%d %d", &h, &w) && (h != 0 || w != 0)) {
for (int i = 0; i < h; i++) {
printf("#");
for (int j = 0; i < h - 2; j++) {
printf(".");
}
printf("#\n");
}
printf("\n");
}
return 0;
}
| #include <stdio.h>
int main() {
int h, w;
while (scanf("%d %d", &h, &w) && (h != 0 || w != 0)) {
for (int i = 0; i < h; i++) {
printf("#");
for (int j = 0; j < w - 2; j++) {
if (i == 0 || i == h - 1) {
printf("#");
} else {
printf(".");
}
}
printf("#\n");
}
printf("\n");
}
return 0;
}
| replace | 7 | 9 | 7 | 13 | TLE | |
p02404 | C++ | Time Limit Exceeded | #include <iostream>
int main(int argc, char const *argv[]) {
int h, w;
std::cin >> h >> w;
while (!(h == 0 && h == w)) {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; i++) {
if (i == 0 || i == h - 1 || j == 0 || j == w - 1) {
std::cout << "#";
} else {
std::cout << ".";
}
}
std::cout << std::endl;
}
std::cout << std::endl;
std::cin >> h >> w;
}
return 0;
} | #include <iostream>
int main(int argc, char const *argv[]) {
int h, w;
std::cin >> h >> w;
while (!(h == 0 && h == w)) {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (i == 0 || i == h - 1 || j == 0 || j == w - 1) {
std::cout << "#";
} else {
std::cout << ".";
}
}
std::cout << std::endl;
}
std::cout << std::endl;
std::cin >> h >> w;
}
return 0;
} | replace | 7 | 8 | 7 | 8 | TLE | |
p02404 | C++ | Runtime Error | #include <stdio.h>
int main() {
int H, W;
while (1) {
scanf("%d %d", H, W);
if (H == 0 && W == 0)
break;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
if (i == 0 || i == H - 1) {
printf("#");
} else {
if (j == 0 || j == W - 1) {
printf("#");
} else {
printf(".");
}
}
}
printf("\n");
}
printf("\n");
}
return 0;
} | #include <stdio.h>
int main() {
int H, W;
while (1) {
scanf("%d %d", &H, &W);
if (H == 0 && W == 0)
break;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
if (i == 0 || i == H - 1) {
printf("#");
} else {
if (j == 0 || j == W - 1) {
printf("#");
} else {
printf(".");
}
}
}
printf("\n");
}
printf("\n");
}
return 0;
} | replace | 4 | 5 | 4 | 5 | -11 | |
p02404 | C++ | Time Limit Exceeded | #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int H, W;
while (1) {
cin >> H >> W;
for (int i = 0; i < W; i++) {
cout << "#";
}
cout << endl;
for (int i = 0; i < H - 2; i++) {
cout << "#";
for (int i = 0; i < W - 2; i++) {
cout << ".";
}
cout << "#" << endl;
}
for (int i = 0; i < W; i++) {
cout << "#";
}
cout << endl << endl;
}
return 0;
} | #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int H, W;
while (1) {
cin >> H >> W;
if (H == 0 && W == 0)
return 0;
for (int i = 0; i < W; i++) {
cout << "#";
}
cout << endl;
for (int i = 0; i < H - 2; i++) {
cout << "#";
for (int i = 0; i < W - 2; i++) {
cout << ".";
}
cout << "#" << endl;
}
for (int i = 0; i < W; i++) {
cout << "#";
}
cout << endl << endl;
}
return 0;
} | insert | 8 | 8 | 8 | 10 | TLE | |
p02405 | C++ | Time Limit Exceeded | #include <stdio.h>
int main() {
int H, W;
while (1) {
scanf("%d %d", &H, &W);
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
if (i % 2 == 0) {
if (j % 2 == 0) {
printf("#");
} else {
printf(".");
}
} else {
if (j % 2 == 0) {
printf(".");
} else {
printf("#");
}
}
}
printf("\n");
}
printf("\n");
}
return 0;
} | #include <stdio.h>
int main() {
int H, W;
while (1) {
scanf("%d %d", &H, &W);
if (H == 0 && W == 0)
break;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
if (i % 2 == 0) {
if (j % 2 == 0) {
printf("#");
} else {
printf(".");
}
} else {
if (j % 2 == 0) {
printf(".");
} else {
printf("#");
}
}
}
printf("\n");
}
printf("\n");
}
return 0;
} | insert | 5 | 5 | 5 | 7 | TLE | |
p02405 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
while (h != 0 || w != 0) {
int i, j, k;
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
k = i + j;
if (k % 2 == 0)
cout << "#";
else
cout << ".";
}
cout << endl;
}
cout << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
while (h != 0 || w != 0) {
int i, j, k;
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
k = i + j;
if (k % 2 == 0)
cout << "#";
else
cout << ".";
}
cout << endl;
}
cout << endl;
cin >> h >> w;
}
return 0;
}
| insert | 18 | 18 | 18 | 19 | TLE | |
p02405 | C++ | Time Limit Exceeded | #include <stdio.h>
int main() {
int a, b;
while (1) {
scanf("%d %d", &a, &b);
for (int i = 0; i < a; i++) {
for (int j = 0; j < b; j++) {
if (i % 2 == 0) {
if (j % 2 == 0)
printf("#");
else
printf(".");
} else {
if (j % 2 == 0)
printf(".");
else
printf("#");
}
}
printf("\n");
}
printf("\n");
}
return 0;
}
| #include <stdio.h>
int main() {
int a, b;
while (1) {
scanf("%d %d", &a, &b);
if (a == 0 || b == 0)
break;
for (int i = 0; i < a; i++) {
for (int j = 0; j < b; j++) {
if (i % 2 == 0) {
if (j % 2 == 0)
printf("#");
else
printf(".");
} else {
if (j % 2 == 0)
printf(".");
else
printf("#");
}
}
printf("\n");
}
printf("\n");
}
return 0;
}
| insert | 6 | 6 | 6 | 8 | TLE | |
p02405 | C++ | Time Limit Exceeded | #include <iomanip>
#include <iostream>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
while (h != 0 || w != 0) {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if ((i + j) % 2 == 0) {
cout << "#";
} else {
cout << ".";
}
}
cout << endl;
}
cout << endl;
}
} | #include <iomanip>
#include <iostream>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
while (h != 0 || w != 0) {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if ((i + j) % 2 == 0) {
cout << "#";
} else {
cout << ".";
}
}
cout << endl;
}
cout << endl;
cin >> h >> w;
}
} | insert | 19 | 19 | 19 | 20 | TLE | |
p02405 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int H = 0, W = 0;
while (1) {
cin >> H >> W;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
if (i % 2 == 0 && j % 2 == 0)
cout << "#";
if (i % 2 == 0 && j % 2 != 0)
cout << ".";
if (i % 2 != 0 && j % 2 == 0)
cout << ".";
if (i % 2 != 0 && j % 2 != 0)
cout << "#";
}
cout << endl;
}
cout << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int H = 0, W = 0;
while (1) {
cin >> H >> W;
if (H == 0 && W == 0)
break;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
if (i % 2 == 0 && j % 2 == 0)
cout << "#";
if (i % 2 == 0 && j % 2 != 0)
cout << ".";
if (i % 2 != 0 && j % 2 == 0)
cout << ".";
if (i % 2 != 0 && j % 2 != 0)
cout << "#";
}
cout << endl;
}
cout << endl;
}
return 0;
}
| insert | 7 | 7 | 7 | 9 | TLE | |
p02405 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int W, H = 0;
char c = '#';
cin >> H >> W;
do {
for (int i = 0; i < H; i++) {
if (i % 2 == 0) {
c = '#';
} else {
c = '.';
}
for (int j = 0; j < W; j++) {
cout << c;
if (c == '#') {
c = '.';
} else {
c = '#';
}
}
cout << endl;
}
} while ((H != 0) || (W != 0)); //?¶??¶??????¶
return 0;
} | #include <iostream>
using namespace std;
int main() {
int W, H = 0;
char c = '#';
cin >> H >> W;
do {
for (int i = 0; i < H; i++) {
if (i % 2 == 0) {
c = '#';
} else {
c = '.';
}
for (int j = 0; j < W; j++) {
cout << c;
if (c == '#') {
c = '.';
} else {
c = '#';
}
}
cout << endl;
}
cout << endl;
cin >> H >> W;
} while ((H != 0) || (W != 0)); //?¶??¶??????¶
return 0;
} | insert | 24 | 24 | 24 | 26 | TLE | |
p02405 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
while (1) {
int h, w;
cin >> h >> w;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if ((i + j) % 2 == 0) {
cout << "#";
} else {
cout << ".";
}
}
cout << endl;
}
cout << endl;
}
} | #include <iostream>
using namespace std;
int main() {
while (1) {
int h, w;
cin >> h >> w;
if (h == 0 && w == 0) {
break;
}
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if ((i + j) % 2 == 0) {
cout << "#";
} else {
cout << ".";
}
}
cout << endl;
}
cout << endl;
}
} | insert | 6 | 6 | 6 | 9 | TLE | |
p02405 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
for (int x = 0; true; x++) {
int h, w;
cin >> h >> w;
for (int i = 1; i <= h; i++) {
for (int j = 1; j <= w; j++) {
if ((i + j) % 2 == 0) {
cout << "#";
} else {
cout << ".";
}
if (j == w) {
cout << endl;
}
}
if (i == h) {
cout << endl;
}
}
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
for (int x = 0; true; x++) {
int h, w;
cin >> h >> w;
if (h == 0 && w == 0)
break;
for (int i = 1; i <= h; i++) {
for (int j = 1; j <= w; j++) {
if ((i + j) % 2 == 0) {
cout << "#";
} else {
cout << ".";
}
if (j == w) {
cout << endl;
}
}
if (i == h) {
cout << endl;
}
}
}
return 0;
} | insert | 8 | 8 | 8 | 11 | TLE | |
p02406 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; ++i) {
int x = i;
if (x % 3 == 0) {
cout << " " << i;
continue;
} else {
while (x) {
if (x % 10 == 3) {
cout << " " << i;
continue;
}
x /= 10;
}
}
}
cout << endl;
}
| #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; ++i) {
int x = i;
if (x % 3 == 0) {
cout << " " << i;
continue;
} else {
while (x) {
if (x % 10 == 3) {
cout << " " << i;
break;
}
x /= 10;
}
}
}
cout << endl;
}
| replace | 17 | 18 | 17 | 18 | TLE | |
p02406 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int n;
int main() {
cin >> n;
for (int i = 1; i <= n; ++i) {
int x = i;
if (x % 3 == 0) {
cout << " " << i;
} else {
while (x >= 0) {
if (x % 10 == 3) {
cout << " " << i;
break;
}
x = x / 10;
}
}
}
cout << endl;
} | #include <iostream>
using namespace std;
int n;
int main() {
cin >> n;
for (int i = 1; i <= n; ++i) {
int x = i;
if (x % 3 == 0) {
cout << " " << i;
} else {
while (x > 0) {
if (x % 10 == 3) {
cout << " " << i;
break;
}
x = x / 10;
}
}
}
cout << endl;
} | replace | 12 | 13 | 12 | 13 | TLE | |
p02406 | C++ | Time Limit Exceeded | #include <iostream>
#include <stdio.h>
using namespace std;
int main(void) {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
int x = i;
if (x % 3 == 0) {
cout << " " << i;
} else {
do {
if (x % 10 == 3) {
cout << " " << i;
break;
}
x /= 10;
} while (1);
}
}
cout << endl;
return 0;
}
| #include <iostream>
#include <stdio.h>
using namespace std;
int main(void) {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
int x = i;
if (x % 3 == 0) {
cout << " " << i;
} else {
do {
if (x % 10 == 3) {
cout << " " << i;
break;
}
x /= 10;
} while (x);
}
}
cout << endl;
return 0;
}
| replace | 18 | 19 | 18 | 19 | TLE | |
p02406 | C++ | Time Limit Exceeded | #include <cstdio>
#include <iomanip>
#include <iostream>
using namespace std;
const int M = 100000;
const double pi = 3.141592653589;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 3 == 0) {
cout << " " << i;
} else {
int x = i;
while ((x % 10) != 3 || x != 0) {
x /= 10;
}
if (x != 0) {
cout << " " << i;
}
}
}
cout << endl;
return 0;
} | #include <cstdio>
#include <iomanip>
#include <iostream>
using namespace std;
const int M = 100000;
const double pi = 3.141592653589;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 3 == 0) {
cout << " " << i;
} else {
int x = i;
while ((x % 10) != 3 && x != 0) {
x /= 10;
}
if (x != 0) {
cout << " " << i;
}
}
}
cout << endl;
return 0;
} | replace | 15 | 16 | 15 | 16 | TLE | |
p02406 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
int x = i;
while (x > 0) {
if (x % 3 == 0 || x % 10 == 3) {
cout << " " << i;
} else {
x /= 10;
}
}
}
cout << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 3 == 0) {
cout << " " << i;
} else {
for (int x = i; x != 0; x /= 10) {
if (x % 10 == 3) {
cout << " " << i;
break;
}
}
}
}
cout << endl;
return 0;
} | replace | 7 | 13 | 7 | 15 | TLE | |
p02406 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <math.h>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <string>
using namespace std;
int main(void) {
long n, q[1000];
cin >> n;
for (long i = 1; i < n + 1; i++) {
if (i % 3 == 0) {
cout << " " << i;
q[i] = -1;
} else if (i % 10 == 3) {
cout << " " << i;
q[i] = -1;
}
ostringstream p;
p << i;
string pp;
pp = p.str();
int k = 0;
k = pp.size();
for (int j = 0; j < k; j++) {
if (pp.substr(j, 1) == "3" && q[i] != -1) {
cout << " " << i;
break;
}
}
}
cout << endl;
}
| #include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <math.h>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <string>
using namespace std;
int main(void) {
long n, q[10000];
cin >> n;
for (long i = 1; i < n + 1; i++) {
if (i % 3 == 0) {
cout << " " << i;
q[i] = -1;
} else if (i % 10 == 3) {
cout << " " << i;
q[i] = -1;
}
ostringstream p;
p << i;
string pp;
pp = p.str();
int k = 0;
k = pp.size();
for (int j = 0; j < k; j++) {
if (pp.substr(j, 1) == "3" && q[i] != -1) {
cout << " " << i;
break;
}
}
}
cout << endl;
}
| replace | 13 | 14 | 13 | 14 | 0 | |
p02406 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int i = 1;
for (int i = 1; i <= n; i++) {
int x = i;
if (x % 3 == 0) {
cout << " " << i;
continue;
}
do {
if (x % 10 == 3) {
cout << " " << i;
continue;
}
x /= 10;
} while (x);
}
cout << endl;
}
| #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int i = 1;
for (int i = 1; i <= n; i++) {
int x = i;
if (x % 3 == 0) {
cout << " " << i;
continue;
}
do {
if (x % 10 == 3) {
cout << " " << i;
break;
}
x /= 10;
} while (x);
}
cout << endl;
}
| replace | 16 | 17 | 16 | 17 | TLE | |
p02406 | C++ | Time Limit Exceeded | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 3 == 0) {
cout << " " << i;
} else if (i % 10 == 3) {
cout << " " << i;
} else if ((i /= 10) % 10 == 3) {
cout << " " << i;
}
}
cout << endl;
}
| #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 3 == 0) {
cout << " " << i;
} else if (i % 10 == 3) {
cout << " " << i;
} else if ((i / 10) % 10 == 3) {
cout << " " << i;
} else if ((i / 100) % 10 == 3) {
cout << " " << i;
} else if ((i / 1000) % 10 == 3) {
cout << " " << i;
}
}
cout << endl;
}
| replace | 14 | 15 | 14 | 20 | TLE | |
p02406 | C++ | Runtime Error | #include <iostream>
#include <stdio.h>
int main(void) {
int n;
scanf("%d", n);
int i = 1;
while (++i <= n) {
int x = i;
if (x % 3 == 0) {
std::cout << " " << i;
continue;
}
while (x) {
if (x % 10 == 3) {
std::cout << " " << i;
break;
}
x /= 10;
}
}
std::cout << std::endl;
return 0;
}
| #include <iostream>
#include <stdio.h>
int main(void) {
int n;
scanf("%d", &n);
int i = 1;
while (++i <= n) {
int x = i;
if (x % 3 == 0) {
std::cout << " " << i;
continue;
}
while (x) {
if (x % 10 == 3) {
std::cout << " " << i;
break;
}
x /= 10;
}
}
std::cout << std::endl;
return 0;
}
| replace | 6 | 7 | 6 | 7 | -11 | |
p02406 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
bool has3(int x) {
while (1) {
if (x % 10 == 3)
return true;
x /= 10;
}
return false;
}
void call(int n) {
for (int x = 1; x <= n; x++) {
if (x % 3 == 0 || has3(x)) {
cout << " " << x;
}
}
cout << endl;
}
int main() {
int n;
cin >> n;
call(n); // your code goes here
return 0;
} | #include <iostream>
using namespace std;
bool has3(int x) {
while (x) {
if (x % 10 == 3)
return true;
x /= 10;
}
return false;
}
void call(int n) {
for (int x = 1; x <= n; x++) {
if (x % 3 == 0 || has3(x)) {
cout << " " << x;
}
}
cout << endl;
}
int main() {
int n;
cin >> n;
call(n); // your code goes here
return 0;
} | replace | 4 | 5 | 4 | 5 | TLE | |
p02406 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int a = 1, b, c, count = 0;
cin >> b;
for (; count < b; count++) {
if (a % 3 == 0 || a % 10 == 3) {
cout << ' ' << a;
} else {
for (c = 1; c != 0;) {
c = a / 10;
if (c % 10 == 3) {
cout << ' ' << a;
break;
}
}
}
a++;
}
cout << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int a = 1, b, c, count = 0;
cin >> b;
for (; count < b; count++) {
if (a % 3 == 0 || a % 10 == 3) {
cout << ' ' << a;
} else {
for (c = a; c != 0;) {
c /= 10;
if (c % 10 == 3) {
cout << ' ' << a;
break;
}
}
}
a++;
}
cout << endl;
return 0;
} | replace | 9 | 11 | 9 | 11 | TLE | |
p02406 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
void call(int n);
void call(int n) {
int x;
for (int i = 1; i <= n; i++) {
x = i;
if (x % 3 == 0) {
cout << " " << i;
} else {
do {
if (x % 10 == 3) {
cout << " " << i;
break;
}
x / 10;
} while (x);
}
}
cout << endl;
}
int main(void) {
int n;
cin >> n;
call(n);
} | #include <iostream>
using namespace std;
void call(int n);
void call(int n) {
int x;
for (int i = 1; i <= n; i++) {
x = i;
if (x % 3 == 0) {
cout << " " << i;
} else {
do {
if (x % 10 == 3) {
cout << " " << i;
break;
}
x /= 10;
} while (x);
}
}
cout << endl;
}
int main(void) {
int n;
cin >> n;
call(n);
} | replace | 18 | 19 | 18 | 19 | TLE | |
p02406 | C++ | Runtime Error | #include <iostream>
using namespace std;
void CHECK_NUM(int, int);
void INCLUDE3(int, int, int);
void END_CHECK_NUM(int, int);
int main() {
int n;
cin >> n;
CHECK_NUM(n, 1);
return 0;
}
void CHECK_NUM(int n, int i) {
int x = i;
if (x % 3 == 0) {
cout << " " << i;
END_CHECK_NUM(n, i);
}
INCLUDE3(x, i, n);
}
void INCLUDE3(int x, int i, int n) {
if (x % 10 == 3) {
cout << " " << i;
END_CHECK_NUM(n, i);
}
x /= 10;
if (x) {
INCLUDE3(x, i, n);
}
END_CHECK_NUM(n, i);
}
void END_CHECK_NUM(int n, int i) {
if (++i <= n) {
CHECK_NUM(n, i);
}
cout << endl;
exit(1);
}
| #include <iostream>
using namespace std;
void CHECK_NUM(int, int);
void INCLUDE3(int, int, int);
void END_CHECK_NUM(int, int);
int main() {
int n;
cin >> n;
CHECK_NUM(n, 1);
return 0;
}
void CHECK_NUM(int n, int i) {
int x = i;
if (x % 3 == 0) {
cout << " " << i;
END_CHECK_NUM(n, i);
}
INCLUDE3(x, i, n);
}
void INCLUDE3(int x, int i, int n) {
if (x % 10 == 3) {
cout << " " << i;
END_CHECK_NUM(n, i);
}
x /= 10;
if (x) {
INCLUDE3(x, i, n);
}
END_CHECK_NUM(n, i);
}
void END_CHECK_NUM(int n, int i) {
if (++i <= n) {
CHECK_NUM(n, i);
}
cout << endl;
exit(EXIT_SUCCESS);
}
| replace | 43 | 44 | 43 | 44 | 1 | |
p02406 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
void nabeatsu(int n) {
int x;
for (int i = 1; i <= n; i++) {
x = i;
if (x % 3 == 0) {
cout << " " << i;
} else if (x % 10 == 3) {
cout << " " << i;
} else {
x /= 10;
if (x % 10 == 3) {
cout << " " << i;
} else if (x / 10 % 10 == 3) {
cout << " " << i;
} else if (x / 100 % 10 == 3) {
cout << " " << i;
}
}
}
cout << endl;
}
int main() {
int n;
cin >> n;
nabeatsu(n);
while (1) {
}
return 0;
} | #include <iostream>
using namespace std;
void nabeatsu(int n) {
int x;
for (int i = 1; i <= n; i++) {
x = i;
if (x % 3 == 0) {
cout << " " << i;
} else if (x % 10 == 3) {
cout << " " << i;
} else {
x /= 10;
if (x % 10 == 3) {
cout << " " << i;
} else if (x / 10 % 10 == 3) {
cout << " " << i;
} else if (x / 100 % 10 == 3) {
cout << " " << i;
}
}
}
cout << endl;
}
int main() {
int n;
cin >> n;
nabeatsu(n);
return 0;
} | delete | 29 | 31 | 29 | 29 | TLE | |
p02406 | C++ | Time Limit Exceeded | #include <iostream>
int main() {
int n;
std::cin >> n;
for (int i = 1; i <= n; i++) {
int x = i;
if (i % 3 == 0) {
std::cout << " " << i;
continue;
} else
while (x) {
if (x % 10 == 3) {
std::cout << " " << i;
continue;
}
x /= 10;
}
}
std::cout << std::endl;
return 0;
} | #include <iostream>
int main() {
int n;
std::cin >> n;
for (int i = 1; i <= n; i++) {
int x = i;
if (i % 3 == 0) {
std::cout << " " << i;
continue;
} else
while (x) {
if (x % 10 == 3) {
std::cout << " " << i;
break;
}
x /= 10;
}
}
std::cout << std::endl;
return 0;
} | replace | 14 | 15 | 14 | 15 | TLE | |
p02406 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin >> a;
for (int i = 1; i <= a; i++) {
if (i % 3 == 0) {
cout << " " << i;
} else {
for (int j = 0;; j++) {
if (i == 0)
break;
if (i % 10 == 3) {
cout << " " << i;
} else {
i = i / 10;
}
}
}
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin >> a;
for (int i = 1; i <= a; i++) {
if (i % 3 == 0) {
cout << " " << i;
} else if (i % 10 == 3) {
cout << " " << i;
} else if ((i / 10) % 10 == 3) {
cout << " " << i;
} else if ((i / 100) % 10 == 3) {
cout << " " << i;
} else if ((i / 1000) % 10 == 3) {
cout << " " << i;
}
if (i == a) {
cout << "\n";
}
}
return 0;
} | replace | 9 | 19 | 9 | 20 | TLE | |
p02406 | C++ | Time Limit Exceeded | #include <iomanip>
#include <iostream>
using namespace std;
int main() {
int n, x;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 3 == 0) {
cout << " " << i;
} else {
x = i;
while (x > 0) {
if (x % 10 == 3) {
cout << " " << i;
} else {
x = x / 10;
}
}
}
}
cout << endl;
} | #include <iomanip>
#include <iostream>
using namespace std;
int main() {
int n, x;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 3 == 0) {
cout << " " << i;
} else {
x = i;
while (x > 0) {
if (x % 10 == 3) {
cout << " " << i;
break;
} else {
x = x / 10;
}
}
}
}
cout << endl;
} | insert | 15 | 15 | 15 | 16 | TLE | |
p02407 | Python | Runtime Error | n = int(input)
lst = list(map(int, input().split()))
print(" ".join(lst[::-1]))
| input()
print(" ".join(input().split()[::-1]))
| replace | 0 | 3 | 0 | 2 | TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02407/Python/s871236231.py", line 1, in <module>
n = int(input)
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'
|
p02407 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, m;
int maximum;
int a[1000];
while (true) {
cin >> n >> m;
if (n == 0 && m == 0)
break;
maximum = 0;
for (int j = 0; j < n; j++) {
cin >> a[j];
}
for (int j = 0; j < n - 1; j++) {
for (int t = j + 1; t < n; t++) {
if (a[j] + a[t] <= m) {
maximum = max(maximum, a[j] + a[t]);
}
}
}
if (maximum == 0) {
cout << "NONE" << endl;
} else {
cout << maximum << endl;
}
}
}
| #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = n - 1; 0 < i; i--)
cout << a[i] << " ";
cout << a[0] << endl;
}
| replace | 12 | 36 | 12 | 20 | TLE | |
p02407 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int a[105];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = n - 1; i > 0; i++)
cout << a[i] << " ";
cout << a[0] << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int a[105];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = n - 1; i > 0; i--)
cout << a[i] << " ";
cout << a[0] << endl;
}
| replace | 8 | 9 | 8 | 9 | -11 | |
p02407 | C++ | Runtime Error | #include <iostream>
#include <vector>
#define loop(i, a, b) for (int i = a; i < b; i++)
#define rep(i, a) loop(i, 0, a)
using namespace std;
int main() {
int n;
vector<int> in(n);
rep(i, n) cin >> in[i];
rep(i, n - 1) cout << in[n - i - 1] << " ";
cout << in[0] << endl;
} | #include <iostream>
#include <vector>
#define loop(i, a, b) for (int i = a; i < b; i++)
#define rep(i, a) loop(i, 0, a)
using namespace std;
int main() {
int n;
cin >> n;
vector<int> in(n);
rep(i, n) cin >> in[i];
rep(i, n - 1) cout << in[n - i - 1] << " ";
cout << in[0] << endl;
} | insert | 7 | 7 | 7 | 8 | 0 | |
p02407 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main(void) {
int n, a[5] = {0};
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = n - 1; i >= 0; i--) {
if (i == n - 1) {
cout << a[i];
} else {
cout << " " << a[i];
}
}
cout << endl;
}
| #include <iostream>
using namespace std;
int main(void) {
int n, a[100] = {0};
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = n - 1; i >= 0; i--) {
if (i == n - 1) {
cout << a[i];
} else {
cout << " " << a[i];
}
}
cout << endl;
}
| replace | 3 | 4 | 3 | 4 | 0 | |
p02407 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> numbers(n - 1);
for (int i = 0; i < n; i++) {
cin >> numbers[i];
}
for (int i = n; i > 1; i--) {
cout << numbers[i - 1] << ' ';
}
cout << numbers[0] << endl;
return 0;
} | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> numbers(n);
for (int i = 0; i < n; i++) {
cin >> numbers[i];
}
for (int i = n; i > 1; i--) {
cout << numbers[i - 1] << ' ';
}
cout << numbers[0] << endl;
return 0;
} | replace | 7 | 8 | 7 | 8 | 0 | |
p02407 | C++ | Time Limit Exceeded | #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[100];
for (int i = 0; i < n; i++) {
cin >> a[i];
if (i == n - 1) {
cout << a[i];
for (i = n - 2; i >= 0; i--) {
cout << " " << a[i];
}
}
}
return 0;
}
| #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[100];
for (int i = 0; i < n; i++) {
cin >> a[i];
if (i == n - 1) {
cout << a[i];
for (i = n - 2; i >= 0; i--) {
cout << " " << a[i];
}
cout << endl;
break;
}
}
return 0;
}
| insert | 16 | 16 | 16 | 18 | TLE | |
p02407 | Python | Runtime Error | n = int(input())
a = list(map(int, input().split()))
a.reverse()
print(" ".join(a))
| n = int(input())
a = list(input().split())
a.reverse()
print(" ".join(a))
| replace | 1 | 2 | 1 | 2 | TypeError: sequence item 0: expected str instance, int found | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02407/Python/s100431651.py", line 4, in <module>
print(' '.join(a))
TypeError: sequence item 0: expected str instance, int found
|
p02407 | C++ | Time Limit Exceeded | #include <cstdio>
#include <iostream>
using namespace std;
#define MAX 100
int main(void) {
int n, a[MAX], i = 0;
do {
cin >> n;
} while (n > MAX || n < 0);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
while (1) {
printf("%d", a[n - i]);
if (i == n)
break;
printf(" ");
}
printf("\n");
return 0;
} | #include <cstdio>
#include <iostream>
using namespace std;
#define MAX 100
int main(void) {
int n, a[MAX], i = 0;
do {
cin >> n;
} while (n > MAX || n < 0);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
while (1) {
printf("%d", a[n - i - 1]);
if (i++ == n - 1)
break;
printf(" ");
}
printf("\n");
return 0;
} | replace | 16 | 18 | 16 | 18 | TLE | |
p02407 | C++ | Runtime Error | #include <iostream>
// #include <stdio.h>
using namespace std;
int main() {
int n, m;
int a[10];
cin >> n;
// a = (int *)malloc(sizeof(int) * n);
for (int i = 0; i < n; i++) {
cin >> m;
a[i] = m;
}
for (int i = n - 1; i > 0; i--) {
cout << a[i] << " ";
}
cout << a[0];
cout << endl;
return 0;
} | #include <iostream>
// #include <stdio.h>
using namespace std;
int main() {
int n, m;
int a[1000];
cin >> n;
// a = (int *)malloc(sizeof(int) * n);
for (int i = 0; i < n; i++) {
cin >> m;
a[i] = m;
}
for (int i = n - 1; i > 0; i--) {
cout << a[i] << " ";
}
cout << a[0];
cout << endl;
return 0;
} | replace | 6 | 7 | 6 | 7 | 0 | |
p02407 | C++ | Runtime Error | #include <stdio.h>
int main(void) {
int i, n;
int arr[] = {};
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}
for (i = 0; i < (n / 2); i++) {
int temp = arr[i];
arr[i] = arr[(n - 1) - i];
arr[(n - 1) - i] = temp;
}
for (i = 0; i < n; i++) {
if (i) {
printf(" ");
}
printf("%d", arr[i]);
}
printf("\n");
return 0;
} | #include <stdio.h>
int main(void) {
int i, n;
int arr[100] = {0};
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}
for (i = 0; i < (n / 2); i++) {
int temp = arr[i];
arr[i] = arr[(n - 1) - i];
arr[(n - 1) - i] = temp;
}
for (i = 0; i < n; i++) {
if (i) {
printf(" ");
}
printf("%d", arr[i]);
}
printf("\n");
return 0;
} | replace | 4 | 5 | 4 | 5 | -6 | *** stack smashing detected ***: terminated
|
p02407 | C++ | Runtime Error | #define _USE_MATH_DEFINES
#include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define ll long long
const int MOD = 1000000007; // 10^9+7
const string SPACE = " ";
ll max(ll a, ll b) {
if (a > b)
return a;
else
return b;
}
double max(double a, double b) {
if (a > b)
return a;
else
return b;
}
// a??¨b?????§?????????
ll min(ll a, ll b) {
if (a < b)
return a;
else
return b;
}
// a??¨b????°??????????
ll avd_i(ll a, ll b) {
if (a > b)
return a - b;
else
return b - a;
}
double avd_d(double a, double b) {
double re;
if (a > b)
re = a - b;
else
re = b - a;
return re;
}
// a??¨b???????????¶??????
ll powsur(ll a, ll b, ll p) {
if (b == 0) {
return 1;
} else if (b % 2 == 0) {
ll d = powsur(a, b / 2, p);
return ((d % p) * (d % p)) % p;
} else {
return ((a % p) * powsur(a, b - 1, p) % p) % p;
}
}
// p????´???°,a???b??????p??§?????£?????????
ll CMOD(ll n, ll r, ll p) {
ll a = 1, b = 1, c = 1, re;
for (int i = 1; i <= n; i++) {
a *= i;
a = a % p;
}
for (int i = 1; i <= r; i++) {
b *= i;
b = b % p;
}
for (int i = 1; i <= n - r; i++) {
c *= i;
c = c % p;
}
b = powsur(b, p - 2, p);
c = powsur(c, p - 2, p);
re = ((a % p) * (b % p)) % p;
re = ((re % p) * c % p) % p;
return re;
}
// p????´???°,(nCr)%p
ll gcd(ll a, ll b) {
if (a > b) {
ll tmp = a;
a = b;
b = tmp;
}
ll r;
r = b % a;
if (r == 0)
return a;
else
return gcd(r, a);
}
//?????§??¬?´???°
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
//????°???¬?????°
int main() {
int n, a[105];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = n - 1; i >= 1; i++) {
cout << a[i] << " ";
}
cout << a[0] << endl;
return 0;
} | #define _USE_MATH_DEFINES
#include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define ll long long
const int MOD = 1000000007; // 10^9+7
const string SPACE = " ";
ll max(ll a, ll b) {
if (a > b)
return a;
else
return b;
}
double max(double a, double b) {
if (a > b)
return a;
else
return b;
}
// a??¨b?????§?????????
ll min(ll a, ll b) {
if (a < b)
return a;
else
return b;
}
// a??¨b????°??????????
ll avd_i(ll a, ll b) {
if (a > b)
return a - b;
else
return b - a;
}
double avd_d(double a, double b) {
double re;
if (a > b)
re = a - b;
else
re = b - a;
return re;
}
// a??¨b???????????¶??????
ll powsur(ll a, ll b, ll p) {
if (b == 0) {
return 1;
} else if (b % 2 == 0) {
ll d = powsur(a, b / 2, p);
return ((d % p) * (d % p)) % p;
} else {
return ((a % p) * powsur(a, b - 1, p) % p) % p;
}
}
// p????´???°,a???b??????p??§?????£?????????
ll CMOD(ll n, ll r, ll p) {
ll a = 1, b = 1, c = 1, re;
for (int i = 1; i <= n; i++) {
a *= i;
a = a % p;
}
for (int i = 1; i <= r; i++) {
b *= i;
b = b % p;
}
for (int i = 1; i <= n - r; i++) {
c *= i;
c = c % p;
}
b = powsur(b, p - 2, p);
c = powsur(c, p - 2, p);
re = ((a % p) * (b % p)) % p;
re = ((re % p) * c % p) % p;
return re;
}
// p????´???°,(nCr)%p
ll gcd(ll a, ll b) {
if (a > b) {
ll tmp = a;
a = b;
b = tmp;
}
ll r;
r = b % a;
if (r == 0)
return a;
else
return gcd(r, a);
}
//?????§??¬?´???°
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
//????°???¬?????°
int main() {
int n, a[105];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = n - 1; i >= 1; i--) {
cout << a[i] << " ";
}
cout << a[0] << endl;
return 0;
} | replace | 135 | 136 | 135 | 136 | -11 | |
p02407 | C++ | Runtime Error | #include <stdio.h>
int main(void) {
int i, n;
scanf("%d", &n);
int a[n];
for (i = 0; i < n; ++i)
scanf("%d", a[i]);
for (i = n - 1; i >= 0; --i) {
if (i)
printf("%d ", a[i]);
else
printf("%d\n", a[i]);
}
return 0;
}
| #include <stdio.h>
int main(void) {
int i, n;
scanf("%d", &n);
int a[n];
for (i = 0; i < n; ++i)
scanf("%d", &a[i]);
for (i = n - 1; i >= 0; --i) {
if (i)
printf("%d ", a[i]);
else
printf("%d\n", a[i]);
}
return 0;
}
| replace | 7 | 8 | 7 | 8 | -11 | |
p02407 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#define _USE_MATH_DEFINES
#include <functional>
#include <math.h>
#include <stdio.h>
#include <vector>
using namespace std;
int n;
vector<int> v;
int main() {
cin >> n;
for (int i = 0; i < n; ++i) {
int buf;
cin >> buf;
v.push_back(buf);
}
// sort(v.begin(), v.end(), greater<int>());
vector<int>::reverse_iterator it, end;
for (it = v.rbegin(), end = v.rend(); it != end; --it) {
cout << (*it) << " ";
}
cout << endl;
return 0;
} | #include <algorithm>
#include <iostream>
#define _USE_MATH_DEFINES
#include <functional>
#include <math.h>
#include <stdio.h>
#include <vector>
using namespace std;
int n;
vector<int> v;
int main() {
cin >> n;
for (int i = 0; i < n; ++i) {
int buf;
cin >> buf;
v.push_back(buf);
}
// sort(v.begin(), v.end(), greater<int>());
vector<int>::reverse_iterator it, end;
for (it = v.rbegin(), end = v.rend(); it != end; ++it) {
if (it == v.rbegin())
cout << (*it);
else
cout << " " << (*it);
}
cout << endl;
return 0;
} | replace | 23 | 25 | 23 | 28 | -11 | |
p02407 | C++ | Time Limit Exceeded | #include <stdio.h>
int main() {
int n = 0;
scanf("%d", &n);
int a[n + 1];
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
for (int i = n - 1; i = 1; i--) {
printf("%d ", a[i]);
}
printf("%d\n", a[0]);
return 0;
}
| #include <stdio.h>
int main() {
int n = 0;
scanf("%d", &n);
int a[n + 1];
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
for (int i = n - 1; i >= 1; i--) {
printf("%d ", a[i]);
}
printf("%d\n", a[0]);
return 0;
}
| replace | 10 | 11 | 10 | 11 | TLE | |
p02407 | C++ | Runtime Error | #include <cstdio>
int main(void) {
int n;
int a[1000];
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
for (int i = n - 1; i > 0; i++) {
printf("%d ", a[i]);
}
printf("%d\n", a[0]);
return 0;
} | #include <cstdio>
int main(void) {
int n;
int a[1000];
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
for (int i = n - 1; i > 0; i--) {
printf("%d ", a[i]);
}
printf("%d\n", a[0]);
return 0;
} | replace | 8 | 9 | 8 | 9 | -11 | |
p02408 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int cards[3][12] = {0};
int num, i, x, y;
char ch;
cin >> num;
for (i = 0; i < num; i++) {
cin >> ch >> y;
if (ch == 'S')
x = 0;
else if (ch == 'H')
x = 1;
else if (ch == 'C')
x = 2;
else
x = 3;
cards[x][y - 1] = 1;
}
int j, k;
for (j = 0; j < 4; j++) {
for (k = 0; k < 13; k++) {
if (cards[j][k] != 1) {
if (j == 0)
cout << "S " << k + 1 << endl;
else if (j == 1)
cout << "H " << k + 1 << endl;
else if (j == 2)
cout << "C " << k + 1 << endl;
else
cout << "D " << k + 1 << endl;
}
}
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int cards[4][13] = {0};
int num, i, x, y;
char ch;
cin >> num;
for (i = 0; i < num; i++) {
cin >> ch >> y;
if (ch == 'S')
x = 0;
else if (ch == 'H')
x = 1;
else if (ch == 'C')
x = 2;
else
x = 3;
cards[x][y - 1] = 1;
}
int j, k;
for (j = 0; j < 4; j++) {
for (k = 0; k < 13; k++) {
if (cards[j][k] != 1) {
if (j == 0)
cout << "S " << k + 1 << endl;
else if (j == 1)
cout << "H " << k + 1 << endl;
else if (j == 2)
cout << "C " << k + 1 << endl;
else
cout << "D " << k + 1 << endl;
}
}
}
return 0;
}
| replace | 3 | 4 | 3 | 4 | -6 | *** stack smashing detected ***: terminated
|
p02408 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int cards[4][13] = {};
int n;
cin >> n;
for (int i = 0; i < n; i++) {
char c;
int a;
cin >> c >> a;
for (int j = 0; j < n; j++) {
if (c == 'S') {
cards[0][a] = 1;
} else if (c == 'H') {
cards[1][a] = 1;
} else if (c == 'C') {
cards[2][a] = 1;
} else {
cards[3][a] = 1;
}
}
}
for (int k = 0; k <= 3; k++) {
for (int l = 1; l <= 13; l++) {
if (cards[k][l] == 0) {
if (k == 0) {
cout << "S " << l << endl;
}
if (k == 1) {
cout << "H " << l << endl;
}
if (k == 2) {
cout << "C " << l << endl;
}
if (k == 3) {
cout << "D " << l << endl;
}
}
}
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int cards[4][14] = {};
int n;
cin >> n;
for (int i = 0; i < n; i++) {
char c;
int a;
cin >> c >> a;
for (int j = 0; j < n; j++) {
if (c == 'S') {
cards[0][a] = 1;
} else if (c == 'H') {
cards[1][a] = 1;
} else if (c == 'C') {
cards[2][a] = 1;
} else {
cards[3][a] = 1;
}
}
}
for (int k = 0; k <= 3; k++) {
for (int l = 1; l <= 13; l++) {
if (cards[k][l] == 0) {
if (k == 0) {
cout << "S " << l << endl;
}
if (k == 1) {
cout << "H " << l << endl;
}
if (k == 2) {
cout << "C " << l << endl;
}
if (k == 3) {
cout << "D " << l << endl;
}
}
}
}
return 0;
}
| replace | 3 | 4 | 3 | 4 | 0 | |
p02408 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
char ch, card[4][13] = {false};
int n, i, a, j, k;
cin >> n;
for (i = 0; i < n; i++) {
cin >> ch >> a;
if (ch == 'S') {
card[0][a] = true;
}
if (ch == 'H') {
card[1][a] = true;
}
if (ch == 'C') {
card[2][a] = true;
}
if (ch == 'D') {
card[3][a] = true;
}
}
for (j = 0; j < 4; j++) {
for (k = 1; k < 14; k++) {
if (!card[j][k]) {
if (j == 0) {
cout << 'S' << " " << k << endl;
}
if (j == 1) {
cout << 'H' << " " << k << endl;
}
if (j == 2) {
cout << 'C' << " " << k << endl;
}
if (j == 3) {
cout << 'D' << " " << k << endl;
}
}
}
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
char ch, card[4][14] = {false};
int n, i, a, j, k;
cin >> n;
for (i = 0; i < n; i++) {
cin >> ch >> a;
if (ch == 'S') {
card[0][a] = true;
}
if (ch == 'H') {
card[1][a] = true;
}
if (ch == 'C') {
card[2][a] = true;
}
if (ch == 'D') {
card[3][a] = true;
}
}
for (j = 0; j < 4; j++) {
for (k = 1; k < 14; k++) {
if (!card[j][k]) {
if (j == 0) {
cout << 'S' << " " << k << endl;
}
if (j == 1) {
cout << 'H' << " " << k << endl;
}
if (j == 2) {
cout << 'C' << " " << k << endl;
}
if (j == 3) {
cout << 'D' << " " << k << endl;
}
}
}
}
return 0;
}
| replace | 3 | 4 | 3 | 4 | 0 | |
p02408 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int n, x;
int card[4][13] = {0};
char t;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> t >> x;
switch (t) {
case 'S':
card[0][x] = 1;
break;
case 'H':
card[1][x] = 1;
break;
case 'C':
card[2][x] = 1;
break;
case 'D':
card[3][x] = 1;
break;
}
}
for (int i = 0; i < 4; i++) {
for (int j = 1; j <= 13; j++) {
if (card[i][j] == 0) {
switch (i) {
case 0:
cout << 'S' << ' ' << j << endl;
break;
case 1:
cout << 'H' << ' ' << j << endl;
break;
case 2:
cout << 'C' << ' ' << j << endl;
break;
case 3:
cout << 'D' << ' ' << j << endl;
break;
}
}
}
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int n, x;
int card[5][14] = {0};
char t;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> t >> x;
switch (t) {
case 'S':
card[0][x] = 1;
break;
case 'H':
card[1][x] = 1;
break;
case 'C':
card[2][x] = 1;
break;
case 'D':
card[3][x] = 1;
break;
}
}
for (int i = 0; i < 4; i++) {
for (int j = 1; j <= 13; j++) {
if (card[i][j] == 0) {
switch (i) {
case 0:
cout << 'S' << ' ' << j << endl;
break;
case 1:
cout << 'H' << ' ' << j << endl;
break;
case 2:
cout << 'C' << ' ' << j << endl;
break;
case 3:
cout << 'D' << ' ' << j << endl;
break;
}
}
}
}
return 0;
}
| replace | 4 | 5 | 4 | 5 | 0 | |
p02408 | C++ | Runtime Error | #include <iostream>
int main() {
char si;
int n, mi;
int v[4][13] = {};
std::cin >> n;
for (int a = 0; a < n; a++) {
std::cin >> si >> mi;
if (si == 'S')
v[0][mi] = 1;
if (si == 'H')
v[1][mi] = 1;
if (si == 'C')
v[2][mi] = 1;
if (si == 'D')
v[3][mi] = 1;
}
for (int s = 0; s < 4; s++) {
for (int m = 0; m < 14; m++) {
if (v[s][m] != 1 && m != 0) {
if (s == 0)
std::cout << "S " << m << std::endl;
if (s == 1)
std::cout << "H " << m << std::endl;
if (s == 2)
std::cout << "C " << m << std::endl;
if (s == 3)
std::cout << "D " << m << std::endl;
}
}
}
return 0;
} | #include <iostream>
int main() {
char si;
int n, mi;
int v[4][14] = {0};
std::cin >> n;
for (int a = 0; a < n; a++) {
std::cin >> si >> mi;
if (si == 'S')
v[0][mi] = 1;
if (si == 'H')
v[1][mi] = 1;
if (si == 'C')
v[2][mi] = 1;
if (si == 'D')
v[3][mi] = 1;
}
for (int s = 0; s < 4; s++) {
for (int m = 0; m < 14; m++) {
if (v[s][m] != 1 && m != 0) {
if (s == 0)
std::cout << "S " << m << std::endl;
if (s == 1)
std::cout << "H " << m << std::endl;
if (s == 2)
std::cout << "C " << m << std::endl;
if (s == 3)
std::cout << "D " << m << std::endl;
}
}
}
return 0;
} | replace | 4 | 5 | 4 | 5 | 0 | |
p02408 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
bool cards[4][13];
int n, rank;
char suit;
for (int s = 0; s < 4; s++)
for (int r = 1; r <= 13; r++)
cards[s][r] = 0; //??¨??¨???????´????false??????
cin >> n;
for (int i = 0; i < n; i++) {
cin >> suit >> rank;
if (suit == 'S')
cards[0][rank] = 1;
if (suit == 'H')
cards[1][rank] = 1;
if (suit == 'C')
cards[2][rank] = 1;
if (suit == 'D')
cards[3][rank] = 1;
}
for (int s = 0; s < 4; s++) {
for (int r = 1; r <= 13; r++) {
if (cards[s][r])
continue;
if (s == 0)
suit = 'S';
if (s == 1)
suit = 'H';
if (s == 2)
suit = 'C';
if (s == 3)
suit = 'D';
cout << suit << " " << r << endl;
}
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
bool cards[4][14];
int n, rank;
char suit;
for (int s = 0; s < 4; s++)
for (int r = 1; r <= 13; r++)
cards[s][r] = 0; //??¨??¨???????´????false??????
cin >> n;
for (int i = 0; i < n; i++) {
cin >> suit >> rank;
if (suit == 'S')
cards[0][rank] = 1;
if (suit == 'H')
cards[1][rank] = 1;
if (suit == 'C')
cards[2][rank] = 1;
if (suit == 'D')
cards[3][rank] = 1;
}
for (int s = 0; s < 4; s++) {
for (int r = 1; r <= 13; r++) {
if (cards[s][r])
continue;
if (s == 0)
suit = 'S';
if (s == 1)
suit = 'H';
if (s == 2)
suit = 'C';
if (s == 3)
suit = 'D';
cout << suit << " " << r << endl;
}
}
return 0;
} | replace | 4 | 5 | 4 | 5 | 0 | |
p02408 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
int main() {
int n, a;
// boolean???0??§????????????
//?????¨map??§????????¨?????????????????????????????????????????°??????????????§????????¨??????????°????????????????
/*????????????????????????????????????????????????for??§????????????????????????????????¨??§???????????????????????¨??¨ture??\???????\´???????????¨??????
??????????????????????????¨??????????°????????????????*/
bool cards[4][13] = {};
char suit;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> suit >> a;
if (suit == 'S') {
cards[0][a] = 1;
}
if (suit == 'H') {
cards[1][a] = 1;
}
if (suit == 'C') {
cards[2][a] = 1;
}
if (suit == 'D') {
cards[3][a] = 1;
}
}
for (int i = 0; i < 4; ++i) {
for (int j = 1; j <= 13; ++j) {
if (cards[i][j] == 1)
continue;
if (i == 0) {
cout << "S"
<< " " << j << endl;
}
if (i == 1) {
cout << "H"
<< " " << j << endl;
}
if (i == 2) {
cout << "C"
<< " " << j << endl;
}
if (i == 3) {
cout << "D"
<< " " << j << endl;
}
}
}
return 0;
} | #include "bits/stdc++.h"
using namespace std;
int main() {
int n, a;
// boolean???0??§????????????
//?????¨map??§????????¨?????????????????????????????????????????°??????????????§????????¨??????????°????????????????
/*????????????????????????????????????????????????for??§????????????????????????????????¨??§???????????????????????¨??¨ture??\???????\´???????????¨??????
??????????????????????????¨??????????°????????????????*/
bool cards[4][14] = {};
char suit;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> suit >> a;
if (suit == 'S') {
cards[0][a] = 1;
}
if (suit == 'H') {
cards[1][a] = 1;
}
if (suit == 'C') {
cards[2][a] = 1;
}
if (suit == 'D') {
cards[3][a] = 1;
}
}
for (int i = 0; i < 4; ++i) {
for (int j = 1; j <= 13; ++j) {
if (cards[i][j] == 1)
continue;
if (i == 0) {
cout << "S"
<< " " << j << endl;
}
if (i == 1) {
cout << "H"
<< " " << j << endl;
}
if (i == 2) {
cout << "C"
<< " " << j << endl;
}
if (i == 3) {
cout << "D"
<< " " << j << endl;
}
}
}
return 0;
} | replace | 9 | 10 | 9 | 10 | 0 | |
p02408 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#define _USE_MATH_DEFINES
#include <functional>
#include <map>
#include <math.h>
#include <stdio.h>
#include <vector>
using namespace std;
int n;
bool list[4][13];
vector<int> v;
map<char, int> m;
int main() {
m['S'] = 0;
m['H'] = 1;
m['C'] = 2;
m['D'] = 3;
cin >> n;
for (int i = 0; i < n; ++i) {
int num;
char c;
cin >> c >> num;
num--;
list[m[c]][num] = true;
}
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 13;) {
if (!list[i][j]) {
char c = 'z';
switch (i) {
case 0:
c = 'S';
break;
case 1:
c = 'H';
break;
case 2:
c = 'C';
break;
default:
c = 'D';
break;
}
cout << c << " " << j + 1 << endl;
}
}
}
return 0;
} | #include <algorithm>
#include <iostream>
#define _USE_MATH_DEFINES
#include <functional>
#include <map>
#include <math.h>
#include <stdio.h>
#include <vector>
using namespace std;
int n;
bool list[4][13];
vector<int> v;
map<char, int> m;
int main() {
m['S'] = 0;
m['H'] = 1;
m['C'] = 2;
m['D'] = 3;
cin >> n;
for (int i = 0; i < n; ++i) {
int num;
char c;
cin >> c >> num;
num--;
list[m[c]][num] = true;
}
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 13; ++j) {
if (!list[i][j]) {
char c = 'z';
switch (i) {
case 0:
c = 'S';
break;
case 1:
c = 'H';
break;
case 2:
c = 'C';
break;
default:
c = 'D';
break;
}
cout << c << " " << j + 1 << endl;
}
}
}
return 0;
} | replace | 31 | 32 | 31 | 32 | TLE | |
p02408 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
bool cards[4][13];
for (int i = 0; i < 4; i++) {
for (int j = 1; j <= 13; j++) {
cards[i][j] = 1;
}
}
int n, rank;
char mark;
cin >> n;
for (int x = 1; x <= n; x++) {
cin >> mark >> rank;
if (mark == 'S') {
cards[0][rank] = 0;
}
if (mark == 'H') {
cards[1][rank] = 0;
}
if (mark == 'C') {
cards[2][rank] = 0;
}
if (mark == 'D') {
cards[3][rank] = 0;
}
}
for (int i = 0; i < 4; i++) {
for (int j = 1; j <= 13; j++) {
if (cards[i][j] == 0) {
continue;
}
if (i == 0)
mark = 'S';
if (i == 1)
mark = 'H';
if (i == 2)
mark = 'C';
if (i == 3)
mark = 'D';
cout << mark << " " << j << endl;
}
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
int cards[4][14];
for (int i = 0; i < 4; i++) {
for (int j = 1; j <= 13; j++) {
cards[i][j] = 1;
}
}
int n, rank;
char mark;
cin >> n;
for (int x = 1; x <= n; x++) {
cin >> mark >> rank;
if (mark == 'S') {
cards[0][rank] = 0;
}
if (mark == 'H') {
cards[1][rank] = 0;
}
if (mark == 'C') {
cards[2][rank] = 0;
}
if (mark == 'D') {
cards[3][rank] = 0;
}
}
for (int i = 0; i < 4; i++) {
for (int j = 1; j <= 13; j++) {
if (cards[i][j] == 0) {
continue;
}
if (i == 0)
mark = 'S';
if (i == 1)
mark = 'H';
if (i == 2)
mark = 'C';
if (i == 3)
mark = 'D';
cout << mark << " " << j << endl;
}
}
return 0;
} | replace | 4 | 5 | 4 | 5 | 0 | |
p02408 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int n, N;
char K;
cin >> n;
bool cards[4][13];
for (int i = 0; i < 4; i++) {
for (int j = 1; j <= 13; j++) {
cards[i][j] = 0;
}
}
for (int i = 0; i < n; i++) {
cin >> K >> N;
if (K == 'S') {
cards[0][N] = 1;
}
if (K == 'H') {
cards[1][N] = 1;
}
if (K == 'C') {
cards[2][N] = 1;
}
if (K == 'D') {
cards[3][N] = 1;
}
}
for (int i = 0; i < 4; i++) {
for (int j = 1; j <= 13; j++) {
if (cards[i][j]) {
continue;
}
if (i == 0) {
K = 'S';
}
if (i == 1) {
K = 'H';
}
if (i == 2) {
K = 'C';
}
if (i == 3) {
K = 'D';
}
cout << K << " " << j << endl;
}
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int n, N;
char K;
cin >> n;
bool cards[4][14];
for (int i = 0; i < 4; i++) {
for (int j = 1; j <= 13; j++) {
cards[i][j] = 0;
}
}
for (int i = 0; i < n; i++) {
cin >> K >> N;
if (K == 'S') {
cards[0][N] = 1;
}
if (K == 'H') {
cards[1][N] = 1;
}
if (K == 'C') {
cards[2][N] = 1;
}
if (K == 'D') {
cards[3][N] = 1;
}
}
for (int i = 0; i < 4; i++) {
for (int j = 1; j <= 13; j++) {
if (cards[i][j]) {
continue;
}
if (i == 0) {
K = 'S';
}
if (i == 1) {
K = 'H';
}
if (i == 2) {
K = 'C';
}
if (i == 3) {
K = 'D';
}
cout << K << " " << j << endl;
}
}
return 0;
}
| replace | 6 | 7 | 6 | 7 | 0 | |
p02408 | Python | Runtime Error | suit = {"S": 0, "H": 1, "C": 2, "D": 3}
suit_keys = list(suit.keys())
deck = [[suit_keys[i] + " " + str(j + 1) for j in range(13)] for i in range(4)]
for _ in range(int(input())):
card = input().split()
deck[suit[card[0]]][int(card[1])] = ""
for i in range(4):
for j in deck[i]:
if j != "":
print(j)
| suit = {"S": 0, "H": 1, "C": 2, "D": 3}
suit_keys = list(suit.keys())
deck = [[suit_keys[i] + " " + str(j + 1) for j in range(13)] for i in range(4)]
for _ in range(int(input())):
card = input().split()
deck[suit[card[0]]][int(card[1]) - 1] = ""
for i in range(4):
for j in deck[i]:
if j != "":
print(j)
| replace | 5 | 6 | 5 | 6 | IndexError: list assignment index out of range | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02408/Python/s709538093.py", line 6, in <module>
deck[suit[card[0]]][int(card[1])] = ""
IndexError: list assignment index out of range
|
p02408 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int S[13], H[13], C[13], D[13], N, num;
char mark;
cin >> N;
for (int i = 0; i < N; i++)
S[i] = 0, H[i] = 0, C[i] = 0, D[i] = 0;
for (int i = 0; i < N; i++) {
cin >> mark >> num;
if (mark == 'S')
S[num - 1] = 1;
if (mark == 'H')
H[num - 1] = 1;
if (mark == 'C')
C[num - 1] = 1;
if (mark == 'D')
D[num - 1] = 1;
}
for (int i = 0; i < 13; i++)
if (S[i] == 0)
cout << "S " << i + 1 << endl;
for (int i = 0; i < 13; i++)
if (H[i] == 0)
cout << "H " << i + 1 << endl;
for (int i = 0; i < 13; i++)
if (C[i] == 0)
cout << "C " << i + 1 << endl;
for (int i = 0; i < 13; i++)
if (D[i] == 0)
cout << "D " << i + 1 << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int S[13], H[13], C[13], D[13], N, num;
char mark;
cin >> N;
for (int i = 0; i < 13; i++)
S[i] = 0, H[i] = 0, C[i] = 0, D[i] = 0;
for (int i = 0; i < N; i++) {
cin >> mark >> num;
if (mark == 'S')
S[num - 1] = 1;
if (mark == 'H')
H[num - 1] = 1;
if (mark == 'C')
C[num - 1] = 1;
if (mark == 'D')
D[num - 1] = 1;
}
for (int i = 0; i < 13; i++)
if (S[i] == 0)
cout << "S " << i + 1 << endl;
for (int i = 0; i < 13; i++)
if (H[i] == 0)
cout << "H " << i + 1 << endl;
for (int i = 0; i < 13; i++)
if (C[i] == 0)
cout << "C " << i + 1 << endl;
for (int i = 0; i < 13; i++)
if (D[i] == 0)
cout << "D " << i + 1 << endl;
return 0;
}
| replace | 7 | 8 | 7 | 8 | -6 | *** stack smashing detected ***: terminated
|
p02408 | C++ | Runtime Error | #include <stdio.h>
int main(void) {
int a, s[5][13], d = 0, f, g, h, j, i;
char z[2];
for (i = 1; i <= 13; i++) {
s[1][i] = 0;
s[2][i] = 0;
s[3][i] = 0;
s[4][i] = 0;
}
scanf("%d", &a);
for (i = 1; i <= a; i++) {
scanf(" %c %d", &z[1], &d);
// printf("%d %d\n",i,d);
if (z[1] == 'S') {
s[1][d] = 1;
} else if (z[1] == 'H') {
s[2][d] = 1;
} else if (z[1] == 'C') {
s[3][d] = 1;
} else if (z[1] == 'D') {
s[4][d] = 1;
}
}
for (i = 1; i <= 4; i++) {
for (j = 1; j <= 13; j++) {
if (s[i][j] == 0) {
if (i == 1)
printf("S %d\n", j);
if (i == 2)
printf("H %d\n", j);
if (i == 3)
printf("C %d\n", j);
if (i == 4)
printf("D %d\n", j);
}
}
}
return 0;
} | #include <stdio.h>
int main(void) {
int a, s[5][14], d = 0, f, g, h, j, i;
char z[2];
for (i = 1; i <= 13; i++) {
s[1][i] = 0;
s[2][i] = 0;
s[3][i] = 0;
s[4][i] = 0;
}
scanf("%d", &a);
for (i = 1; i <= a; i++) {
scanf(" %c %d", &z[1], &d);
// printf("%d %d\n",i,d);
if (z[1] == 'S') {
s[1][d] = 1;
} else if (z[1] == 'H') {
s[2][d] = 1;
} else if (z[1] == 'C') {
s[3][d] = 1;
} else if (z[1] == 'D') {
s[4][d] = 1;
}
}
for (i = 1; i <= 4; i++) {
for (j = 1; j <= 13; j++) {
if (s[i][j] == 0) {
if (i == 1)
printf("S %d\n", j);
if (i == 2)
printf("H %d\n", j);
if (i == 3)
printf("C %d\n", j);
if (i == 4)
printf("D %d\n", j);
}
}
}
return 0;
} | replace | 2 | 3 | 2 | 3 | 0 | |
p02408 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
bool card[3][12] = {false};
int n, o, p;
string x;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x >> o;
if (x == "S") {
card[0][o - 1] = true;
} else if (x == "H") {
card[1][o - 1] = true;
} else if (x == "C") {
card[2][o - 1] = true;
} else if (x == "D") {
card[3][o - 1] = true;
}
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 13; j++) {
if (card[i][j] == false) {
if (i == 0) {
cout << "S " << j + 1 << endl;
} else if (i == 1) {
cout << "H " << j + 1 << endl;
} else if (i == 2) {
cout << "C " << j + 1 << endl;
} else if (i == 3) {
cout << "D " << j + 1 << endl;
}
}
}
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
bool card[4][13] = {false};
int n, o, p;
string x;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x >> o;
if (x == "S") {
card[0][o - 1] = true;
} else if (x == "H") {
card[1][o - 1] = true;
} else if (x == "C") {
card[2][o - 1] = true;
} else if (x == "D") {
card[3][o - 1] = true;
}
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 13; j++) {
if (card[i][j] == false) {
if (i == 0) {
cout << "S " << j + 1 << endl;
} else if (i == 1) {
cout << "H " << j + 1 << endl;
} else if (i == 2) {
cout << "C " << j + 1 << endl;
} else if (i == 3) {
cout << "D " << j + 1 << endl;
}
}
}
}
}
| replace | 4 | 5 | 4 | 5 | -6 | *** stack smashing detected ***: terminated
|
p02408 | C++ | Runtime Error | #include <iostream>
using namespace std;
int changeNum(char c) {
switch (c) {
case 'S':
return 0;
case 'H':
return 1;
case 'C':
return 2;
case 'D':
return 3;
}
}
int main(void) {
int n, suit, num;
bool card[4][13];
cin >> n;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 13; j++) {
card[i][j] = false;
}
}
char c;
for (int i = 0; i < n; i++) {
cin >> c >> num;
card[changeNum(c)][num - 1] = true;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 13; j++) {
if (!card[i][j]) {
switch (i) {
case 0:
cout << "S " << j + 1;
break;
case 1:
cout << "H " << j + 1;
break;
case 2:
cout << "C " << j + 1;
break;
case 3:
cout << "D " << j + 1;
}
cout << endl;
}
}
}
return 1;
} | #include <iostream>
using namespace std;
int changeNum(char c) {
switch (c) {
case 'S':
return 0;
case 'H':
return 1;
case 'C':
return 2;
case 'D':
return 3;
}
}
int main(void) {
int n, suit, num;
bool card[4][13];
cin >> n;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 13; j++) {
card[i][j] = false;
}
}
char c;
for (int i = 0; i < n; i++) {
cin >> c >> num;
card[changeNum(c)][num - 1] = true;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 13; j++) {
if (!card[i][j]) {
switch (i) {
case 0:
cout << "S " << j + 1;
break;
case 1:
cout << "H " << j + 1;
break;
case 2:
cout << "C " << j + 1;
break;
case 3:
cout << "D " << j + 1;
}
cout << endl;
}
}
}
return 0;
} | replace | 54 | 55 | 54 | 55 | 1 | |
p02408 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int cards[52] = {};
char mark;
int num;
for (int i = 0; i < n; i++) {
cin >> mark >> num;
switch (mark) {
case 'S':
break;
case 'H':
num += 13;
break;
case 'C':
num += 26;
break;
case 'D':
num += 39;
break;
}
cards[num] = num;
}
for (int i = 1; i <= 52; i++) {
if (cards[i] == 0) {
switch ((i - 1) / 13) {
case 0:
mark = 'S';
break;
case 1:
mark = 'H';
break;
case 2:
mark = 'C';
break;
case 3:
mark = 'D';
break;
}
cout << mark << " " << (i - ((i - 1) / 13) * 13) << endl;
}
}
return 0;
} | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
bool cards[53] = {};
char mark;
int num;
for (int i = 0; i < n; i++) {
cin >> mark >> num;
switch (mark) {
case 'S':
break;
case 'H':
num += 13;
break;
case 'C':
num += 26;
break;
case 'D':
num += 39;
break;
}
cards[num] = num;
}
for (int i = 1; i <= 52; i++) {
if (cards[i] == 0) {
switch ((i - 1) / 13) {
case 0:
mark = 'S';
break;
case 1:
mark = 'H';
break;
case 2:
mark = 'C';
break;
case 3:
mark = 'D';
break;
}
cout << mark << " " << (i - ((i - 1) / 13) * 13) << endl;
}
}
return 0;
} | replace | 7 | 8 | 7 | 8 | 0 | |
p02408 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int card[51] = {0};
int total, number;
char type;
cin >> total;
for (int i = 0; i < total; i++) {
cin >> type >> number;
if (type == 'S') {
card[number - 1] = {1};
}
if (type == 'H') {
card[number + 12] = {1};
}
if (type == 'C') {
card[number + 25] = {1};
}
if (type == 'D') {
card[number + 38] = {1};
}
}
for (int i = 0; i < 52; i++) {
if (card[i] == 0) {
if (i < 13) {
cout << "S"
<< " " << i + 1 << endl;
}
if (i >= 13 && i < 26) {
cout << "H"
<< " " << i - 12 << endl;
}
if (i >= 26 && i < 39) {
cout << "C"
<< " " << i - 25 << endl;
}
if (i >= 39 && i < 52) {
cout << "D"
<< " " << i - 38 << endl;
}
}
}
}
| #include <iostream>
using namespace std;
int main() {
int card[52] = {0};
int total, number;
char type;
cin >> total;
for (int i = 0; i < total; i++) {
cin >> type >> number;
if (type == 'S') {
card[number - 1] = {1};
}
if (type == 'H') {
card[number + 12] = {1};
}
if (type == 'C') {
card[number + 25] = {1};
}
if (type == 'D') {
card[number + 38] = {1};
}
}
for (int i = 0; i < 52; i++) {
if (card[i] == 0) {
if (i < 13) {
cout << "S"
<< " " << i + 1 << endl;
}
if (i >= 13 && i < 26) {
cout << "H"
<< " " << i - 12 << endl;
}
if (i >= 26 && i < 39) {
cout << "C"
<< " " << i - 25 << endl;
}
if (i >= 39 && i < 52) {
cout << "D"
<< " " << i - 38 << endl;
}
}
}
}
| replace | 4 | 5 | 4 | 5 | 0 | |
p02408 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int s[13];
int h[13];
int c[13];
int d[13];
int n, m;
char cr;
for (int i = 1; i <= 13; i++)
s[i] = 0;
for (int i = 1; i <= 13; i++)
h[i] = 0;
for (int i = 1; i <= 13; i++)
c[i] = 0;
for (int i = 1; i <= 13; i++)
d[i] = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> cr >> m;
switch (cr) {
case 'S':
s[m] = 1;
break;
case 'H':
h[m] = 1;
break;
case 'C':
c[m] = 1;
break;
case 'D':
d[m] = 1;
break;
}
}
for (int i = 1; i <= 13; i++)
if (s[i] == 0)
cout << 'S' << ' ' << i << endl;
for (int i = 1; i <= 13; i++)
if (h[i] == 0)
cout << 'H' << ' ' << i << endl;
for (int i = 1; i <= 13; i++)
if (c[i] == 0)
cout << 'C' << ' ' << i << endl;
for (int i = 1; i <= 13; i++)
if (d[i] == 0)
cout << 'D' << ' ' << i << endl;
}
| #include <iostream>
using namespace std;
int main() {
int s[14];
int h[14];
int c[14];
int d[14];
int n, m;
char cr;
for (int i = 1; i <= 13; i++)
s[i] = 0;
for (int i = 1; i <= 13; i++)
h[i] = 0;
for (int i = 1; i <= 13; i++)
c[i] = 0;
for (int i = 1; i <= 13; i++)
d[i] = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> cr >> m;
switch (cr) {
case 'S':
s[m] = 1;
break;
case 'H':
h[m] = 1;
break;
case 'C':
c[m] = 1;
break;
case 'D':
d[m] = 1;
break;
}
}
for (int i = 1; i <= 13; i++)
if (s[i] == 0)
cout << 'S' << ' ' << i << endl;
for (int i = 1; i <= 13; i++)
if (h[i] == 0)
cout << 'H' << ' ' << i << endl;
for (int i = 1; i <= 13; i++)
if (c[i] == 0)
cout << 'C' << ' ' << i << endl;
for (int i = 1; i <= 13; i++)
if (d[i] == 0)
cout << 'D' << ' ' << i << endl;
}
| replace | 4 | 8 | 4 | 8 | 0 | |
p02409 | C++ | Runtime Error | #include <iostream>
#include <queue>
#include <stack>
#include <stddef.h>
#include <string>
using namespace std;
int main() {
int n;
int b[100];
int f[100];
int r[100];
int v[100];
int k[100];
int room[11][13];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> b[i] >> f[i] >> r[i] >> v[i];
}
for (int i = 0; i < n; i++) {
k[i] = (b[i] - 1) * 3 + f[i];
}
for (int i = 1; i <= 10; i++) {
for (int j = 1; j <= 12; j++) {
room[i][j] = 0;
}
}
for (int i = 0; i < n; i++) {
room[r[i]][k[i]] += v[i];
}
for (int i = 1; i <= 12; i++) {
if (i % 3 == 1 && i != 1)
cout << "####################" << endl;
for (int j = 1; j <= 10; j++) {
cout << ' ' << room[j][i];
}
cout << endl;
}
cin >> n;
} | #include <iostream>
#include <queue>
#include <stack>
#include <stddef.h>
#include <string>
using namespace std;
int main() {
int n;
int b[1000];
int f[1000];
int r[1000];
int v[1000];
int k[1000];
int room[11][13];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> b[i] >> f[i] >> r[i] >> v[i];
}
for (int i = 0; i < n; i++) {
k[i] = (b[i] - 1) * 3 + f[i];
}
for (int i = 1; i <= 10; i++) {
for (int j = 1; j <= 12; j++) {
room[i][j] = 0;
}
}
for (int i = 0; i < n; i++) {
room[r[i]][k[i]] += v[i];
}
for (int i = 1; i <= 12; i++) {
if (i % 3 == 1 && i != 1)
cout << "####################" << endl;
for (int j = 1; j <= 10; j++) {
cout << ' ' << room[j][i];
}
cout << endl;
}
cin >> n;
} | replace | 10 | 15 | 10 | 15 | 0 | |
p02409 | C++ | Runtime Error | #include <iostream>
using namespace std;
struct v {
int a;
int c;
int d;
int e;
};
int main() {
v w[200];
int n, j, m, i, d1[4][11] = {0}, d2[4][11] = {0}, d3[4][11] = {0},
d4[4][11] = {0};
cin >> n;
for (i = 0; i < n; i++) {
cin >> w[i].a >> w[i].c >> w[i].d >> w[i].e;
if (w[i].a == 1) {
d1[w[i].c][w[i].d] += w[i].e;
}
if (w[i].a == 2) {
d2[w[i].c][w[i].d] += w[i].e;
}
if (w[i].a == 3) {
d3[w[i].c][w[i].d] += w[i].e;
}
if (w[i].a == 4) {
d4[w[i].c][w[i].d] += w[i].e;
}
}
for (m = 0; m < 4; m++) {
if (m == 0) {
for (i = 1; i <= 3; i++) {
for (j = 1; j <= 10; j++) {
if (j != 10)
cout << " " << d1[i][j];
else
cout << " " << d1[i][j] << endl;
}
}
for (i = 0; i < 20; i++) {
cout << '#';
}
cout << endl;
}
if (m == 1) {
for (i = 1; i <= 3; i++) {
for (j = 1; j <= 10; j++) {
if (j != 10)
cout << " " << d2[i][j];
else
cout << " " << d2[i][j] << endl;
}
}
for (i = 0; i < 20; i++) {
cout << '#';
}
cout << endl;
}
if (m == 2) {
for (i = 1; i <= 3; i++) {
for (j = 1; j <= 10; j++) {
if (j != 10)
cout << " " << d3[i][j];
else
cout << " " << d3[i][j] << endl;
}
}
for (i = 0; i < 20; i++) {
cout << '#';
}
cout << endl;
}
if (m == 3) {
for (i = 1; i <= 3; i++) {
for (j = 1; j <= 10; j++) {
if (j != 10)
cout << " " << d4[i][j];
else
cout << " " << d4[i][j] << endl;
}
}
}
}
return 0;
} | #include <iostream>
using namespace std;
struct v {
int a;
int c;
int d;
int e;
};
int main() {
v w[1000];
int n, j, m, i, d1[4][11] = {0}, d2[4][11] = {0}, d3[4][11] = {0},
d4[4][11] = {0};
cin >> n;
for (i = 0; i < n; i++) {
cin >> w[i].a >> w[i].c >> w[i].d >> w[i].e;
if (w[i].a == 1) {
d1[w[i].c][w[i].d] += w[i].e;
}
if (w[i].a == 2) {
d2[w[i].c][w[i].d] += w[i].e;
}
if (w[i].a == 3) {
d3[w[i].c][w[i].d] += w[i].e;
}
if (w[i].a == 4) {
d4[w[i].c][w[i].d] += w[i].e;
}
}
for (m = 0; m < 4; m++) {
if (m == 0) {
for (i = 1; i <= 3; i++) {
for (j = 1; j <= 10; j++) {
if (j != 10)
cout << " " << d1[i][j];
else
cout << " " << d1[i][j] << endl;
}
}
for (i = 0; i < 20; i++) {
cout << '#';
}
cout << endl;
}
if (m == 1) {
for (i = 1; i <= 3; i++) {
for (j = 1; j <= 10; j++) {
if (j != 10)
cout << " " << d2[i][j];
else
cout << " " << d2[i][j] << endl;
}
}
for (i = 0; i < 20; i++) {
cout << '#';
}
cout << endl;
}
if (m == 2) {
for (i = 1; i <= 3; i++) {
for (j = 1; j <= 10; j++) {
if (j != 10)
cout << " " << d3[i][j];
else
cout << " " << d3[i][j] << endl;
}
}
for (i = 0; i < 20; i++) {
cout << '#';
}
cout << endl;
}
if (m == 3) {
for (i = 1; i <= 3; i++) {
for (j = 1; j <= 10; j++) {
if (j != 10)
cout << " " << d4[i][j];
else
cout << " " << d4[i][j] << endl;
}
}
}
}
return 0;
} | replace | 9 | 10 | 9 | 10 | 0 | |
p02409 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
int n, b, f, r, v, ro[3][4][10];
for (int i = 0; i < 4; i++)
for (int j = 0; j < 3; j++)
for (int k = 0; k < 10; k++)
ro[i][j][k] = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> b >> f >> r >> v;
ro[b - 1][f - 1][r - 1] += v;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
cout << " " << ro[i][j][k];
}
cout << endl;
}
if (i != 3) {
for (int j = 0; j < 20; j++)
cout << "#";
cout << endl;
}
}
return 0;
}
| #include <iostream>
#include <string>
using namespace std;
int main() {
int n, b, f, r, v, ro[4][3][10];
for (int i = 0; i < 4; i++)
for (int j = 0; j < 3; j++)
for (int k = 0; k < 10; k++)
ro[i][j][k] = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> b >> f >> r >> v;
ro[b - 1][f - 1][r - 1] += v;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
cout << " " << ro[i][j][k];
}
cout << endl;
}
if (i != 3) {
for (int j = 0; j < 20; j++)
cout << "#";
cout << endl;
}
}
return 0;
}
| replace | 4 | 5 | 4 | 5 | -6 | *** stack smashing detected ***: terminated
|
p02409 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int c[4][3][10];
int n, b, f, r, v;
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 3; j++) {
for (int t = 1; t <= 10; t++) {
c[i][j][t] = 0;
}
}
}
cin >> n;
for (int i = 0; i < n; i++) {
cin >> b >> f >> r >> v;
c[b][f][r] += v;
}
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 3; j++) {
for (int t = 1; t <= 10; t++) {
cout << ' ' << c[i][j][t];
}
cout << endl;
}
if (i != 4)
cout << "####################" << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int c[5][5][15];
int n, b, f, r, v;
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 3; j++) {
for (int t = 1; t <= 10; t++) {
c[i][j][t] = 0;
}
}
}
cin >> n;
for (int i = 0; i < n; i++) {
cin >> b >> f >> r >> v;
c[b][f][r] += v;
}
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 3; j++) {
for (int t = 1; t <= 10; t++) {
cout << ' ' << c[i][j][t];
}
cout << endl;
}
if (i != 4)
cout << "####################" << endl;
}
return 0;
}
| replace | 4 | 5 | 4 | 5 | -6 | *** stack smashing detected ***: terminated
|
p02409 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int count[4][3][10];
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 3; j++) {
for (int k = 1; k <= 10; k++) {
count[i][j][k] = 0;
}
}
}
int b, f, r, v;
for (int i = 0; i < n; i++) {
cin >> b >> f >> r >> v;
count[b][f][r] += v;
}
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 3; j++) {
for (int k = 1; k <= 10; k++) {
cout << " " << count[i][j][k];
}
cout << endl;
}
if (i < 4) {
for (int l = 0; l < 20; l++) {
cout << "#";
}
cout << endl;
}
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int count[5][4][11];
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 3; j++) {
for (int k = 1; k <= 10; k++) {
count[i][j][k] = 0;
}
}
}
int b, f, r, v;
for (int i = 0; i < n; i++) {
cin >> b >> f >> r >> v;
count[b][f][r] += v;
}
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 3; j++) {
for (int k = 1; k <= 10; k++) {
cout << " " << count[i][j][k];
}
cout << endl;
}
if (i < 4) {
for (int l = 0; l < 20; l++) {
cout << "#";
}
cout << endl;
}
}
return 0;
}
| replace | 5 | 6 | 5 | 6 | -6 | *** stack smashing detected ***: terminated
|
p02409 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
int n, b[120], f[120], r[120], v[120];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> b[i] >> f[i] >> r[i] >> v[i];
}
for (int building = 1; building <= 4; building++) {
for (int floor = 1; floor <= 3; floor++) {
for (int room = 1; room <= 10; room++) {
int t = 0;
for (int i = 0; i < n; i++) {
if (b[i] == building && f[i] == floor && r[i] == room)
t += v[i];
}
cout << ' ' << t;
}
cout << endl;
}
if (building == 4)
break;
cout << "####################" << endl;
}
return 0;
}
| #include <cstdio>
#include <iostream>
using namespace std;
int main() {
int n, b[10000], f[10000], r[10000], v[10000];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> b[i] >> f[i] >> r[i] >> v[i];
}
for (int building = 1; building <= 4; building++) {
for (int floor = 1; floor <= 3; floor++) {
for (int room = 1; room <= 10; room++) {
int t = 0;
for (int i = 0; i < n; i++) {
if (b[i] == building && f[i] == floor && r[i] == room)
t += v[i];
}
cout << ' ' << t;
}
cout << endl;
}
if (building == 4)
break;
cout << "####################" << endl;
}
return 0;
}
| replace | 5 | 6 | 5 | 6 | 0 | |
p02409 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int rooms[4][3][10] = {0};
int n;
cin >> n;
int b, f, r, v;
for (int i = 0; i < n; i++) {
cin >> b >> f >> r >> v;
rooms[b - 1][f - 1][r - 1] = rooms[b - 1][f - 1][r - 1] + v;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
cout << " ";
for (int k = 0; k < 10; k++) {
cout << rooms[i][j][k];
if (k != 9)
cout << " ";
}
cout << endl;
}
if (i != 3)
cout << "####################" << endl;
}
while (1)
;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int rooms[4][3][10] = {0};
int n;
cin >> n;
int b, f, r, v;
for (int i = 0; i < n; i++) {
cin >> b >> f >> r >> v;
rooms[b - 1][f - 1][r - 1] = rooms[b - 1][f - 1][r - 1] + v;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
cout << " ";
for (int k = 0; k < 10; k++) {
cout << rooms[i][j][k];
if (k != 9)
cout << " ";
}
cout << endl;
}
if (i != 3)
cout << "####################" << endl;
}
return 0;
} | delete | 30 | 32 | 30 | 30 | TLE | |
p02409 | C++ | Time Limit Exceeded | #include <iostream>
int main(void) {
using namespace std;
int auni[4][3][10];
int i, j, k;
for (i = 0; i < 4; i++) {
for (j = 0; j < 3; j++) {
for (k = 0; k < 10; k++) {
auni[i][j][k] = 0;
}
}
}
int n, b, f, r, v;
cin >> n;
for (i = 0; i < n; i++) {
cin >> b >> f >> r >> v;
auni[b - 1][f - 1][r - 1] += v;
}
for (i = 0; i < 4; i++) {
for (j = 0; j < 3; j++) {
for (k = 0; k < 10; k++) {
cout << ' ' << auni[i][j][k];
}
cout << endl;
}
if (i == 3)
continue;
cout << "####################" << endl;
}
while (true)
;
return 0;
} | #include <iostream>
int main(void) {
using namespace std;
int auni[4][3][10];
int i, j, k;
for (i = 0; i < 4; i++) {
for (j = 0; j < 3; j++) {
for (k = 0; k < 10; k++) {
auni[i][j][k] = 0;
}
}
}
int n, b, f, r, v;
cin >> n;
for (i = 0; i < n; i++) {
cin >> b >> f >> r >> v;
auni[b - 1][f - 1][r - 1] += v;
}
for (i = 0; i < 4; i++) {
for (j = 0; j < 3; j++) {
for (k = 0; k < 10; k++) {
cout << ' ' << auni[i][j][k];
}
cout << endl;
}
if (i == 3)
continue;
cout << "####################" << endl;
}
return 0;
} | replace | 30 | 32 | 30 | 31 | TLE | |
p02409 | C++ | Runtime Error | #include <cstdio>
int main() {
int n, b, f, r, v;
int rooms[4][3][10] = {};
scanf("%d", &n);
int infos[n][4];
for (int i = 0; i < n; i++) {
scanf("%d%d%d%d", infos[i][0], infos[i][1], infos[i][2], infos[i][3]);
}
for (int i = 0; i < n; i++) {
rooms[infos[i][0] - 1][infos[i][1] - 1][infos[i][2] - 1] += infos[i][3];
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
printf(" %d", rooms[i][j][k]);
}
printf("\n");
}
if (i != 3)
printf("####################\n");
}
return 0;
} | #include <cstdio>
int main() {
int n, b, f, r, v;
int rooms[4][3][10] = {};
scanf("%d", &n);
int infos[n][4];
for (int i = 0; i < n; i++) {
scanf("%d%d%d%d", &infos[i][0], &infos[i][1], &infos[i][2], &infos[i][3]);
}
for (int i = 0; i < n; i++) {
rooms[infos[i][0] - 1][infos[i][1] - 1][infos[i][2] - 1] += infos[i][3];
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
printf(" %d", rooms[i][j][k]);
}
printf("\n");
}
if (i != 3)
printf("####################\n");
}
return 0;
} | replace | 8 | 9 | 8 | 9 | -11 | |
p02409 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int rooms[4][3][10]; // ○棟○階○部屋
int n;
int b[120], f[120], r[120], v[120]; // b棟f階r番目v人 (v<0の場合退去)
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
rooms[i][j][k] = 0;
}
}
}
cin >> n;
for (int l = 0; l < n; l++) {
cin >> b[l] >> f[l] >> r[l] >> v[l];
rooms[b[l] - 1][f[l] - 1][r[l] - 1] =
rooms[b[l] - 1][f[l] - 1][r[l] - 1] + v[l];
}
for (int p = 0; p < 3; p++) {
for (int m = 0; m < 3; m++) {
for (int o = 0; o < 10; o++) {
cout << " " << rooms[p][m][o];
}
cout << endl;
}
cout << "####################" << endl;
}
for (int q = 0; q < 3; q++) {
for (int r = 0; r < 10; r++) {
cout << " " << rooms[3][q][r];
}
cout << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int rooms[4][3][10]; // ○棟○階○部屋
int n;
int b[999], f[999], r[999], v[999]; // b棟f階r番目v人 (v<0の場合退去)
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 10; k++) {
rooms[i][j][k] = 0;
}
}
}
cin >> n;
for (int l = 0; l < n; l++) {
cin >> b[l] >> f[l] >> r[l] >> v[l];
rooms[b[l] - 1][f[l] - 1][r[l] - 1] =
rooms[b[l] - 1][f[l] - 1][r[l] - 1] + v[l];
}
for (int p = 0; p < 3; p++) {
for (int m = 0; m < 3; m++) {
for (int o = 0; o < 10; o++) {
cout << " " << rooms[p][m][o];
}
cout << endl;
}
cout << "####################" << endl;
}
for (int q = 0; q < 3; q++) {
for (int r = 0; r < 10; r++) {
cout << " " << rooms[3][q][r];
}
cout << endl;
}
return 0;
}
| replace | 7 | 8 | 7 | 8 | 0 | |
p02410 | C++ | Runtime Error | #include <stdio.h>
int main() {
int n, m, i, j;
long long a[100][100] = {0}, b[110] = {0}, c[110] = {0};
scanf("%d %d", &n, &m);
for (i = 1; i <= n; i++) {
for (j = 1; j <= m; j++) {
scanf("%d", &a[i][j]);
}
}
for (i = 1; i <= m; i++) {
scanf("%d", &b[i]);
}
for (i = 1; i <= n; i++) {
for (j = 1; j <= m; j++) {
c[i] += a[i][j] * b[j];
}
}
for (i = 1; i <= n; i++) {
printf("%d\n", c[i]);
}
return 0;
} | #include <stdio.h>
int main() {
int n, m, i, j;
static int a[100][100] = {0}, b[110] = {0}, c[110] = {0};
scanf("%d %d", &n, &m);
for (i = 1; i <= n; i++) {
for (j = 1; j <= m; j++) {
scanf("%d", &a[i][j]);
}
}
for (i = 1; i <= m; i++) {
scanf("%d", &b[i]);
}
for (i = 1; i <= n; i++) {
for (j = 1; j <= m; j++) {
c[i] += a[i][j] * b[j];
}
}
for (i = 1; i <= n; i++) {
printf("%d\n", c[i]);
}
return 0;
} | replace | 3 | 4 | 3 | 4 | 0 | |
p02410 | C++ | Runtime Error | #include <stdio.h>
/********
* ??????????????¨????????????
*********/
/*********??¢?????´?????????
* (1)????¬????????????¨????¬??????????????????????
* (2)????¬?????????????????¬????????????¨?????????
* (3)
*********/
int main(void) {
int n, m; //?????°n????????°m
int a, b, c;
int i, j;
int gyouretu_a[100][100] = {{0}}, gyouretu_b[100] = {0},
gyouretu_c[100] = {0};
scanf("%d %d\n", &n, &m);
for (i = 1; i <= n; i++) { // A?????\???
for (j = 1; j <= m; j++) {
scanf("%d", &a);
gyouretu_a[i][j] = a;
if (j < (m - 1)) {
scanf(" ");
} else if (j == m) {
scanf("\n");
} else {
//??????????????\??????
}
}
}
for (i = 1; i <= m; i++) { // b?????\???
scanf("%d\n", &b);
gyouretu_b[i] = b;
}
for (i = 1; i <= n; i++) {
for (j = 1; j <= m; j++) {
gyouretu_c[i] += (gyouretu_a[i][j]) * (gyouretu_b[j]);
}
}
for (j = 1; j <= n; j++) { //???????????????
c = gyouretu_c[j];
printf("%d\n", c);
}
return 0;
} | #include <stdio.h>
/********
* ??????????????¨????????????
*********/
/*********??¢?????´?????????
* (1)????¬????????????¨????¬??????????????????????
* (2)????¬?????????????????¬????????????¨?????????
* (3)
*********/
int main(void) {
int n, m; //?????°n????????°m
int a, b, c;
int i, j;
int gyouretu_a[101][101] = {{0}}, gyouretu_b[101] = {0},
gyouretu_c[101] = {0};
scanf("%d %d\n", &n, &m);
for (i = 1; i <= n; i++) { // A?????\???
for (j = 1; j <= m; j++) {
scanf("%d", &a);
gyouretu_a[i][j] = a;
if (j < (m - 1)) {
scanf(" ");
} else if (j == m) {
scanf("\n");
} else {
//??????????????\??????
}
}
}
for (i = 1; i <= m; i++) { // b?????\???
scanf("%d\n", &b);
gyouretu_b[i] = b;
}
for (i = 1; i <= n; i++) {
for (j = 1; j <= m; j++) {
gyouretu_c[i] += (gyouretu_a[i][j]) * (gyouretu_b[j]);
}
}
for (j = 1; j <= n; j++) { //???????????????
c = gyouretu_c[j];
printf("%d\n", c);
}
return 0;
} | replace | 15 | 17 | 15 | 17 | 0 | |
p02410 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> mtr(3, vector<int>(4));
vector<int> vec(m);
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> mtr[i][j];
}
}
for (int i = 0; i < m; i++) {
cin >> vec[i];
}
for (int i = 0; i < n; i++) {
int ret = 0;
for (int j = 0; j < m; j++) {
ret += mtr[i][j] * vec[j];
}
cout << ret << endl;
}
return 0;
} | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> mtr(n, vector<int>(m));
vector<int> vec(m);
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> mtr[i][j];
}
}
for (int i = 0; i < m; i++) {
cin >> vec[i];
}
for (int i = 0; i < n; i++) {
int ret = 0;
for (int j = 0; j < m; j++) {
ret += mtr[i][j] * vec[j];
}
cout << ret << endl;
}
return 0;
} | replace | 7 | 8 | 7 | 8 | 0 | |
p02410 | C++ | Runtime Error | #include <cmath>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int main() {
long n, m, a[100][100], b[100], sum = 0;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
cin >> a[i][j];
}
}
for (int i = 1; i <= m; i++) {
cin >> b[i];
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
sum += a[i][j] * b[j];
}
cout << sum << endl;
sum = 0;
}
return 0;
} | #include <cmath>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int main() {
long n, m, a[101][101], b[101], sum = 0;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
cin >> a[i][j];
}
}
for (int i = 1; i <= m; i++) {
cin >> b[i];
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
sum += a[i][j] * b[j];
}
cout << sum << endl;
sum = 0;
}
return 0;
} | replace | 6 | 7 | 6 | 7 | 0 | |
p02410 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[100][100];
for (int i = 0; i < n; i++)
for (int j = 0; j < m; i++)
cin >> a[i][j];
int b[100];
for (int i = 0; i < m; i++)
cin >> b[i];
int c[100] = {};
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
c[i] += a[i][j] * b[j];
for (int i = 0; i < n; i++)
cout << c[i] << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[100][100];
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
cin >> a[i][j];
int b[100];
for (int i = 0; i < m; i++)
cin >> b[i];
int c[100] = {};
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
c[i] += a[i][j] * b[j];
for (int i = 0; i < n; i++)
cout << c[i] << endl;
}
| replace | 10 | 11 | 10 | 11 | TLE | |
p02410 | C++ | Runtime Error | #include <stdio.h>
#include <stdlib.h>
int main(void) {
int i, j;
int x = 0;
int y = 0;
int z1, z2;
int n, m;
int **a;
int *b;
scanf("%d %d", &n, &m);
a = (int **)malloc(n * sizeof(int));
b = (int *)malloc(m * sizeof(int));
for (i = 0; i < n; i++) {
a[i] = (int *)malloc(m * sizeof(int));
}
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
if (j == 0) {
scanf("%d", &x);
} else {
scanf(" %d", &x);
}
a[i][j] = x;
}
}
for (i = 0; i < m; i++) {
scanf("%d", &x);
b[i] = x;
}
for (i = 0; i < n; i++) {
y = 0;
for (j = 0; j < m; j++) {
z1 = a[i][j];
z2 = b[j];
y += z1 * z2;
}
printf("%d\n", y);
}
for (i = 0; i < n; i++) {
free(a[i]);
}
free(a);
free(b);
return 0;
}
| #include <stdio.h>
#include <stdlib.h>
int main(void) {
int i, j;
int x = 0;
int y = 0;
int z1, z2;
int n, m;
int **a;
int *b;
scanf("%d %d", &n, &m);
a = (int **)malloc(n * sizeof(int *));
b = (int *)malloc(m * sizeof(int));
for (i = 0; i < n; i++) {
a[i] = (int *)malloc(m * sizeof(int));
}
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
if (j == 0) {
scanf("%d", &x);
} else {
scanf(" %d", &x);
}
a[i][j] = x;
}
}
for (i = 0; i < m; i++) {
scanf("%d", &x);
b[i] = x;
}
for (i = 0; i < n; i++) {
y = 0;
for (j = 0; j < m; j++) {
z1 = a[i][j];
z2 = b[j];
y += z1 * z2;
}
printf("%d\n", y);
}
for (i = 0; i < n; i++) {
free(a[i]);
}
free(a);
free(b);
return 0;
}
| replace | 15 | 16 | 15 | 16 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.