buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k | change_count int64 0 100 |
|---|---|---|---|---|---|
#include <stdio.h>
int main() {
unsigned int a, b, x, y;
unsigned int rem;
while (scanf("%d %d", &a, &b) != EOF) {
x = a;
y = b;
while (b != 0) {
if (a < b) {
int tmp = a;
a = b;
b = tmp;
}
rem = a % b;
a = b;
b = rem;
}
}
printf("%d %... | #include <stdio.h>
int main() {
unsigned int a, b, x, y;
unsigned int rem;
while (scanf("%d %d", &a, &b) != EOF) {
x = a;
y = b;
while (b != 0) {
if (a < b) {
int tmp = a;
a = b;
b = tmp;
}
rem = a % b;
a = b;
b = rem;
}
printf("%d %d\n... | [["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]] | 0 | 113 | 2 |
#include <stdio.h>
int main() {
int x, y, z;
while ((scanf("%d %d", &x, &y)) != EOF) {
if (x < y) {
z = x;
x = y;
y = z;
}
int koyaku = gojo(x, y);
long int koubai = (x / y) * koyaku;
printf("%d %d\n", koyaku, koubai);
}
return 0;
}
int gojo(int x, int y) {
int r;
... | #include <stdio.h>
int main() {
int x, y, z;
while (scanf("%d %d", &x, &y) != EOF) {
if (x < y) {
z = x;
x = y;
y = z;
}
int koyaku = gojo(x, y);
long int koubai = (x / koyaku) * y;
printf("%d %d\n", koyaku, koubai);
}
return 0;
}
int gojo(int x, int y) {
int r;
wh... | [["-", 0, 52, 15, 23, 0, 16, 31, 23, 0, 24], ["-", 0, 52, 15, 23, 0, 16, 31, 23, 0, 25], ["-", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]] | 0 | 132 | 6 |
#include <stdio.h>
int gcd(int x, int y) {
if (y == 0)
return x;
else
return gcd(y, x % y);
}
int main() {
int x, y, z;
while (scanf("%d %d", &x, &y) != -1)
z = gcd(x, y), printf("%d %d\n", z, x * y / z);
return 0;
} | #include <stdio.h>
int gcd(int x, int y) {
if (y == 0)
return x;
else
return gcd(y, x % y);
}
int main() {
int x, y, z;
while (scanf("%d %d", &x, &y) != -1)
z = gcd(x, y), printf("%d %d\n", z, y / z * x);
return 0;
} | [["-", 12, 2, 3, 4, 0, 16, 31, 16, 31, 22], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 17, 48], ["+", 0, 34, 12, 2, 3, 4, 0, 16, 17, 48], ["+", 0, 34, 12, 2, 3, 4, 0, 16, 12, 22]] | 0 | 91 | 4 |
#include <stdio.h>
int main(void) {
int a, b, x, y, num, tmp, big, small;
while (scanf("%d%d", &x, &y) != EOF) {
a = x;
b = y;
if (a < b) {
tmp = a;
a = b;
b = tmp;
}
while (b != 0) {
num = a % b;
a = b;
b = num;
}
small = a;
big = x * y / smal... | #include <stdio.h>
int main(void) {
long a, b, x, y, num, tmp, big, small;
while (scanf("%ld %ld", &x, &y) != EOF) {
a = x;
b = y;
if (a < b) {
tmp = a;
a = b;
b = tmp;
}
while (b != 0) {
num = a % b;
a = b;
b = num;
}
small = a;
big = x * y / ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 122 | 6 |
// AOJ
#include <stdio.h>
int main() {
int a, b, r, t, aa, bb;
while (scanf("%d %d", &a, &b) != EOF) {
aa = a;
bb = b;
while (1) {
if (a < b) {
t = a;
a = b;
b = t;
}
r = a % b;
if (r == 0)
break;
a = r;
}
printf("%d %d\n", b, aa * b... | // AOJ
#include <stdio.h>
int main() {
int a, b, r, t, aa, bb;
while (scanf("%d %d", &a, &b) != EOF) {
aa = a;
bb = b;
while (1) {
if (a < b) {
t = a;
a = b;
b = t;
}
r = a % b;
if (r == 0)
break;
a = r;
}
printf("%d %d\n", b, aa * (... | [["+", 0, 2, 3, 4, 0, 16, 12, 23, 0, 24], ["+", 0, 2, 3, 4, 0, 16, 12, 23, 0, 25]] | 0 | 112 | 2 |
#include <stdio.h>
int main(void) {
int x, y;
int x2, y2;
int i, j;
int n;
int gcd, lcm;
while (scanf("%d %d", &x, &y) != EOF) {
x2 = x;
y2 = y;
while (i != 0) {
i = x % y;
gcd = y;
x = y;
y = i;
}
lcm = (x2 / gcd) * y2;
printf("%d %d\n", gcd, lcm);
}
r... | #include <stdio.h>
int main(void) {
int x, y;
int x2, y2;
int i, j;
int n;
int gcd, lcm;
while (scanf("%d %d", &x, &y) != EOF) {
x2 = x;
y2 = y;
i = 1;
while (i != 0) {
i = x % y;
gcd = y;
x = y;
y = i;
}
lcm = (x2 / gcd) * y2;
printf("%d %d\n", gcd, lcm... | [["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]] | 0 | 112 | 4 |
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
long long cc(long long q, long long p) {
if (q % p == 0) {
return p;
} else
return cc(p, q % p);
}
main() {
long long x, y, a[1000], b[1000];
int i = 0;
while (scanf("%lld%lld", &x, &y) != EOF) {
a[i] = cc(x, y);
... | #include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
long long cc(long long q, long long p) {
if (q % p == 0) {
return p;
} else
return cc(p, q % p);
}
main() {
long long x, y, a[1000], b[1000];
int i = 0;
while (scanf("%lld%lld", &x, &y) != EOF) {
a[i] = cc(x, y);
... | [["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22]] | 1 | 156 | 4 |
#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int a, b;
int main() {
while (~scanf("%d%d", &a, &b)) {
printf("%d %d\n", gcd(a, b), a * b / gcd(a, b));
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int a, b;
int main() {
while (~scanf("%d%d", &a, &b)) {
printf("%d %d\n", gcd(a, b), (long long)a * b / gcd(a, b));
}
return 0;
}
| [["+", 3, 4, 0, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 0, 96], ["+", 3, 4, 0, 16, 31, 16, 31, 74, 0, 25]] | 1 | 91 | 4 |
#include <iostream>
#include <utility>
using namespace std;
int main() {
int a, b;
while (cin >> a >> b) {
if (a > b)
swap(a, b);
int A = a, B = b;
while ((a % A != 0) && (b % A != 0)) {
--A;
}
while ((B % a != 0) && (B % b != 0)) {
B += A;
}
cout << A << B << endl;
... | #include <iostream>
#include <utility>
using namespace std;
int main() {
int a, b;
while (cin >> a >> b) {
if (a > b)
swap(a, b);
int A = a, B = b;
while ((a % A != 0) || (b % A != 0)) {
--A;
}
while ((B % a != 0) || (B % b != 0)) {
B += A;
}
cout << A << ' ' << B << e... | [["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 106], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 12, 103, 0, 104], ["+", 0, 16, 31, 16, 31, 16, 12, 103, 0, 125]] | 1 | 109 | 8 |
#include <algorithm>
#include <iostream>
#include <limits>
#include <math.h>
#include <numeric>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl
template <cla... | #include <algorithm>
#include <iostream>
#include <limits>
#include <math.h>
#include <numeric>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl
template <cla... | [["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 207 | 2 |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int a, b, x, y, r;
while (1) {
cin >> a >> b;
if (cin.eof())
break;
x = a;
y = b;
while (1) {
if (b > a)
swap(a, b);
r = a % b;
if (r == 0)
break;
a = b;
b = r;
}
cout << b ... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int a, b, x, y, r;
while (1) {
cin >> a >> b;
if (cin.eof())
break;
x = a;
y = b;
while (1) {
if (b > a)
swap(a, b);
r = a % b;
if (r == 0)
break;
a = b;
b = r;
}
cout << b ... | [["+", 31, 16, 12, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 0, 96], ["+", 31, 16, 12, 16, 31, 16, 31, 74, 0, 25]] | 1 | 114 | 4 |
#include <bits/stdc++.h>
using namespace std;
long long kpk(long long n, long long m) {
long long a, b;
a = n;
b = m;
while (a != b && b != a) {
while (a < b) {
a += n;
}
while (b < a) {
b += m;
}
}
return b;
}
long long fpb(long long n, long long m) {
int r;
if (n < m) {
... | #include <bits/stdc++.h>
using namespace std;
long long kpk(long long n, long long m) {
long long a, b;
a = n;
b = m;
while (a != b && b != a) {
while (a < b) {
a += n;
}
while (b < a) {
b += m;
}
}
return b;
}
long long fpb(long long n, long long m) {
long long r;
if (n <... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22]] | 1 | 180 | 5 |
#include "bits/stdc++.h"
using namespace std;
long long int GCD(long long int a, long long int b) {
return (b % a == b) ? a : GCD(b % a, a);
}
long long int LCM(long long int a, long long int b) {
return (a / GCD(a, b)) * b;
}
int main() {
long long int a, b;
while (cin >> a >> b) {
cout << GCD(a, b) << ... | #include <bits/stdc++.h>
using namespace std;
long long int GCD(long long int a, long long int b) {
return (b % a == 0) ? a : GCD(b % a, a);
}
long long int LCM(long long int a, long long int b) {
return (a / GCD(a, b)) * b;
}
int main() {
long long int a, b;
while (cin >> a >> b) {
cout << GCD(a, b) << ... | [["-", 36, 36, 0, 30, 0, 135, 136, 5, 0, 62], ["-", 36, 36, 0, 30, 0, 135, 136, 5, 0, 6], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["-", 0, 37, 0, 41, 15, 23, 0, 16, 12, 22], ["+", 0, 37, 0, 41, 15, 23, 0, 16, 12, 13]] | 1 | 124 | 6 |
#include <iostream>
using namespace std;
int main() {
for (unsigned long a, b, x, r; cin >> a >> b; cout << x << ' ' << a << endl) {
unsigned long at = a, bt = b;
do {
r = a % b;
a = b;
b = r;
} while (r);
x = at * bt / a;
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
for (unsigned long a, b, x, r; cin >> a >> b; cout << a << ' ' << x << endl) {
unsigned long at = a, bt = b;
do {
r = a % b;
a = b;
b = r;
} while (r);
x = at / a * bt;
}
return 0;
} | [["-", 26, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 26, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 7, 26, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 7, 26, 16, 31, 16, 12, 22], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 8, ... | 1 | 87 | 8 |
#include <iostream>
#include <vector>
using namespace std;
int main() {
int a, b;
int temp;
while (cin >> a >> b) {
if (a < b) {
temp = a;
a = b;
b = temp;
}
int a_ = a, b_ = b;
while (a_ % b_ != 0) {
temp = a_ % b_;
a_ = b_;
b_ = temp;
}
cout << b_ << ... | #include <iostream>
#include <vector>
using namespace std;
int main() {
int a, b;
int temp;
while (cin >> a >> b) {
if (a < b) {
temp = a;
a = b;
b = temp;
}
int a_ = a, b_ = b;
while (a_ % b_ != 0) {
temp = a_ % b_;
a_ = b_;
b_ = temp;
}
cout << b_ << ... | [["-", 0, 16, 31, 16, 12, 16, 31, 16, 31, 22], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]] | 1 | 104 | 4 |
#include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
int a2 = a;
int b2 = b;
while (true) {
if (a > b) {
a = a % b;
} else {
b = b % a;
}
if (a == 0 || b == 0)
break;
}
cout << max(a, b) << " " << a2 / max(a, b) * b2 << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int a, b;
while (cin >> a >> b) {
int a2 = a;
int b2 = b;
while (true) {
if (a > b) {
a = a % b;
} else {
b = b % a;
}
if (a == 0 || b == 0)
break;
}
cout << max(a, b) << " " << a2 / max(a, b) ... | [["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]] | 1 | 103 | 6 |
#include <iostream>
using namespace std;
int GCD(int a, int b) {
if (a % b == 0)
return b;
GCD(b, a % b);
}
int LCM(int a, int b) {
int c = GCD(a, b);
return a * b / c;
}
int main() {
int a, b;
while (cin >> a >> b) {
cout << GCD(a, b) << ' ' << LCM(a, b) << '\n';
}
return 0;
} | #include <iostream>
using namespace std;
int GCD(int a, int b) {
if (a % b == 0)
return b;
GCD(b, a % b);
}
int LCM(int a, int b) {
int c = GCD(a, b);
return a * (b / c);
}
int main() {
int a, b;
while (cin >> a >> b) {
cout << GCD(a, b) << ' ' << LCM(a, b) << '\n';
}
return 0;
} | [["+", 8, 9, 0, 37, 0, 16, 12, 23, 0, 24], ["+", 8, 9, 0, 37, 0, 16, 12, 23, 0, 25]] | 1 | 113 | 2 |
#include <iostream>
int main() {
int a, b;
while (std::cin >> a >> b) {
if (b > a) {
int tmp = a;
a = b;
b = tmp;
}
int m = a;
int n = b;
while (n != 0) {
int tmp = n;
n = m % n;
m = tmp;
}
std::cout << m << " " << (a * b / m) << std::endl;
}
r... | #include <iostream>
int main() {
long a, b;
while (std::cin >> a >> b) {
if (b > a) {
long tmp = a;
a = b;
b = tmp;
}
long m = a;
long n = b;
while (n != 0) {
long tmp = n;
n = m % n;
m = tmp;
}
std::cout << m << " " << (a * b / m) << std::endl;
}... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 57, 64, 9, 0, 43, 39, 40], ["+", 0, 57, 64, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["+", 0, 52, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 104 | 10 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int, int> P;
typedef pair<int, P> P1;
#define fr first
#define... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int, int> P;
typedef pair<int, P> P1;
#define fr first
#define... | [["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["+", 8, 9, 0, 52, 15, 339, 51, 91, 17, 92], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25]] | 1 | 383 | 5 |
#include <stdio.h>
int main() {
long int a, b, a1, b1;
long int r;
while (scanf("%ld %ld", &a1, &b1) != EOF) {
a = a1;
b = b1;
if (a < b) {
r = b;
b = a;
a = r;
}
if (a < 0 || b < 0) {
return 0;
}
r = a % b;
while (r != 0) {
a = b;
b = r;
... |
#include <stdio.h>
int main() {
long int a, b, a1, b1;
long int r;
while (scanf("%ld %ld", &a1, &b1) != EOF) {
a = a1;
b = b1;
if (a < b) {
r = b;
b = a;
a = r;
}
if (a <= 0 || b <= 0) {
return 0;
}
r = a % b;
while (r != 0) {
a = b;
b = r;
... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]] | 1 | 130 | 5 |
#include <algorithm>
#include <cstdio>
int main() {
int a, b;
while (2 == scanf("%d%d", &a, &b))
printf("%d %d\n", std::__gcd(a, b), std::__gcd(a, b) * b);
return 0;
}
| #include <algorithm>
#include <cstdio>
int main() {
int a, b;
while (2 == scanf("%d%d", &a, &b))
printf("%d %d\n", std::__gcd(a, b), a / std::__gcd(a, b) * b);
return 0;
} | [["+", 0, 2, 3, 4, 0, 16, 31, 16, 31, 22], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 17, 85]] | 1 | 63 | 2 |
#include <iostream>
using namespace std;
int gcd(int a, int b) {
// a < b ユークリッドの互除法
if (a == 0)
return b;
return gcd(b % a, a);
}
// lcm = a*b/gcd
int main() {
int a, b;
while (cin >> a >> b) {
int g = gcd(a, b);
cout << g << " " << a * b / g << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int gcd(int a, int b) {
// a < b ユークリッドの互除法
if (a == 0)
return b;
return gcd(b % a, a);
}
// lcm = a*b/gcd
int main() {
int a, b;
while (cin >> a >> b) {
int g = gcd(a, b);
cout << g << " " << a / g * b << endl;
}
return 0;
} | [["-", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]] | 1 | 88 | 4 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define loop(i, a, b) for (int i = (a); i < (int)(b); i++)
#... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define loop(i, a, b) for (int i = (a); i < (int)(b); i++)
#... | [["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]] | 1 | 109 | 6 |
#include <iostream>
using namespace std;
int main() {
int a, b, c, d, e, f, g, l;
cin >> a >> b;
c = a;
d = b;
e = a;
f = b;
while (1) {
if (a > b) {
a %= b;
if (a == 0) {
g = b;
break;
}
} else if (a < b) {
b %= a;
if (b == 0) {
g = a;
... | #include <iostream>
using namespace std;
int main() {
int a, b, c, d, e, f, g, l;
while (cin >> a >> b) {
c = a;
d = b;
e = a;
f = b;
while (1) {
if (a >= b) {
a %= b;
if (a == 0) {
g = b;
break;
}
} else if (a < b) {
b %= a;
... | [["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 14, 8, 9, 0, ... | 1 | 163 | 8 |
#include "bits/stdc++.h"
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define PB push_back
#define MP make_pair
using namespace std;
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
int main() {
int a, b;
while (cin >> a >> b) {
if (a < b)
sw... | #include "bits/stdc++.h"
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define PB push_back
#define MP make_pair
using namespace std;
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
int main() {
int a, b;
while (cin >> a >> b) {
if (a <= b)
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]] | 1 | 114 | 6 |
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int a, b, c, d, e, f;
double x, y;
while (cin >> a >> b >> c >> d >> e >> f) {
x = (c * e - b * f) / (a * e - b * d);
y = (c * d - a * f) / (b * d - a * e);
if (x == 0) {
x = 0.000;
}
if (y == 0) {
y = 0.00... | #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
double a, b, c, d, e, f;
double x, y;
while (cin >> a >> b >> c >> d >> e >> f) {
x = (c * e - b * f) / (a * e - b * d);
y = (c * d - a * f) / (b * d - a * e);
if (x == 0) {
x = 0.000;
}
if (y == 0) {
y = 0... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 133 | 2 |
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define all... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define all... | [["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40]] | 1 | 219 | 2 |
#include <cmath>
#include <iostream>
#include <stdio.h>
#define EPS 0.001
using namespace std;
main() {
int a, b, c, d, e, f;
double x, y;
while (cin >> a >> b >> c >> d >> e >> f) {
x = 1.0 * (c * e - b * f) / (a * e - b * d) + EPS;
y = 1.0 * (c * d - a * f) / (b * d - a * e) + EPS;
printf("%.3lf %... | #include <cmath>
#include <iostream>
#include <stdio.h>
#define EPS 0.00001
using namespace std;
main() {
int a, b, c, d, e, f;
double x, y;
while (cin >> a >> b >> c >> d >> e >> f) {
x = 1.0 * (c * e - b * f) / (a * e - b * d) + EPS;
y = 1.0 * (c * d - a * f) / (b * d - a * e) + EPS;
printf("%.3lf... | [["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]] | 1 | 118 | 2 |
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
double a, b, c, d, e, f;
double x, y;
while (cin >> a >> b >> c >> d >> e >> f) {
x = (c * e - b * f) / (a * e - b * d);
y = (c * d - a * f) / (b * d - a * e);
if (abs(x) < 0.001)
x = 0;
if (abs(y) <... | #include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
double a, b, c, d, e, f;
double x, y;
while (cin >> a >> b >> c >> d >> e >> f) {
x = (c * e - b * f) / (a * e - b * d);
y = (c * d - a * f) / (b * d - a * e);
if (abs(x) < 0.001)
x = 0;
if (abs(y) <... | [["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]] | 1 | 136 | 1 |
/* -*- coding:utf-8 -*- */
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
using namespace std;
int main(void) {
double a, b, c, d, e, f;
while (cin >> a >> b >> c >> d >> e >> f, !cin.eof()) {
cout << "\n";
double x, y;
x = (e * c - b * f) / (a * e - b * d);
y = (-c *... | /* -*- coding:utf-8 -*- */
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
using namespace std;
int main(void) {
double a, b, c, d, e, f;
while (cin >> a >> b >> c >> d >> e >> f, !cin.eof()) {
double x, y;
x = (e * c - b * f) / (a * e - b * d);
y = (-c * d + a * f) / (a *... | [["-", 0, 52, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 44], ["-", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]] | 1 | 164 | 6 |
#include <iostream>
#include <stdio.h>
using namespace std;
void solve() {
int a;
while (cin >> a) {
int b, c, d, e, f;
cin >> b >> c >> d >> e >> f;
double x = (c * e - b * f) / (double)(a * e - b * d);
double y = (c * d - a * f) / (double)(b * d - a * e);
if (x == -0) {
x = 0;
}
... | #include <iostream>
#include <stdio.h>
using namespace std;
void solve() {
int a;
while (cin >> a) {
int b, c, d, e, f;
cin >> b >> c >> d >> e >> f;
double x = (c * e - b * f) / (double)(a * e - b * d);
double y = (c * d - a * f) / (double)(b * d - a * e);
if (x == -0) {
x = 0;
}
... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 151 | 2 |
#include <cstdio>
#include <iomanip>
#include <iostream>
int main() {
int a, b, c, d, e, f;
while (std::cin >> a >> b >> c >> d >> e >> f) {
double x, y;
y = (c * d - a * f) / (b * d - a * e);
x = (c - b * y) / a;
if (x == 0)
x = 0.000;
if (y == 0)
y = 0.000;
printf("%.3f %.3f\n... | #include <cstdio>
#include <iomanip>
#include <iostream>
int main() {
double a, b, c, d, e, f;
while (std::cin >> a >> b >> c >> d >> e >> f) {
double x, y;
y = (c * d - a * f) / (b * d - a * e);
x = (c - b * y) / a;
if (x == 0)
x = 0.000;
if (y == 0)
y = 0.000;
printf("%.3f %.3... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 119 | 2 |
#include <cstdio>
#include <iostream>
using namespace std;
void Solve(double a, double b, double c, double d, double e, double f) {
double x, y;
y = (a * f - d * c) / (a * e - d * b);
x = (c - b * y) / a;
if (x == 0)
x = 0.000;
if (y == 0)
y = 0.000;
printf("%4.3f %4.3f\n", x, y);
}
int main() {... | #include <cstdio>
#include <iostream>
using namespace std;
void Solve(double a, double b, double c, double d, double e, double f) {
double x, y;
y = (a * f - d * c) / (a * e - d * b);
x = (c - b * y) / a;
if (x == 0)
x = 0.000;
if (y == 0)
y = 0.000;
printf("%4.3f %4.3f\n", x, y);
}
int main() {... | [["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]] | 1 | 153 | 6 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
double sisyagonyu(double num, int keta) {
if (keta < 1)
return num;
int i = num * pow(10, keta);
int sg = num * pow(10, keta + 1) - i * 10;
if (sg >= 5)
i++;
else if (sg <= -5)
i--;
return i /... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
double sisyagonyu(double num, int keta) {
if (keta < 1)
return num;
int i = num * pow(10, keta);
int sg = num * pow(10, keta + 1) - i * 10;
if (sg >= 5)
i++;
else if (sg <= -5)
i--;
return i /... | [["-", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["-", 31, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["-", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45]] | 1 | 219 | 6 |
#include <iostream>
#include <stdio.h>
int main() {
double a, b, c, d, e, f;
double x, y;
std::cin >> a >> b >> c >> d >> e >> f;
y = (a * f - d * c) / (a * e - b * d);
x = (c - b * y) / a;
printf("%.3f %.3f\n", x, y);
return 0;
} | #include <iostream>
#include <stdio.h>
int main() {
double a, b, c, d, e, f;
double x, y;
while (std::cin >> a >> b >> c >> d >> e >> f) {
y = (a * f - d * c) / (a * e - b * d);
x = (c - b * y) / a;
printf("%.3f %.3f\n", x, y);
}
return 0;
} | [["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]] | 1 | 93 | 6 |
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int a, b, c, d, e, f;
vector<double> x, y;
while (cin >> a) {
double tmpY;
cin >> b >> c >> d >> e >> f;
if (a * e != b * d) {
y.push_back((c * d - a * f) / (b * d - a * e));
tmpY = (c * d - a * f) ... | #include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
int main() {
double a, b, c, d, e, f;
vector<double> x, y;
while (cin >> a) {
double tmpY;
cin >> b >> c >> d >> e >> f;
if (a * e != b * d) {
y.push_back((c * d - a * f) / (b * d - a * e));
tmpY = (c * d - a * ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 221 | 2 |
#include <iostream>
#include <stdio.h>
using namespace std;
int det(int a00, int a01, int a10, int a11) { return a00 * a11 - a01 * a10; }
int main() {
int a, b, c, d, e, f;
while (cin >> a >> b >> c >> d >> e >> f) {
int t = det(a, b, d, e);
double x = (double)det(c, b, f, e) / t;
double y = (double)d... | #include <iostream>
#include <stdio.h>
using namespace std;
int det(int a00, int a01, int a10, int a11) { return a00 * a11 - a01 * a10; }
int main() {
int a, b, c, d, e, f;
while (cin >> a >> b >> c >> d >> e >> f) {
int t = det(a, b, d, e);
double x = (double)det(c, b, f, e) / t;
double y = (double)d... | [["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]] | 1 | 157 | 1 |
while line = gets
# a,b,c,d,e,f = [2,-1,-3,-9,9,27].map(&:to_f)
a, b, c, d, e, f = line.split(' ').map(&:to_f)
y = a.zero? ? c / b : (f - (d * c / a)) / (e - (b * d / a))
x = d.zero? ? c - (b * y) / a : (f - e * y) / d
x = 0 if x == 0.0
y = 0 if y == 0.0
puts format('%.3f %.3f', x, y)
end
| while line = gets
# a,b,c,d,e,f = [2,-1,-3,-9,9,27].map(&:to_f)
a, b, c, d, e, f = line.split(' ').map(&:to_f)
y = a.zero? ? c / b : (f - (d * c / a)) / (e - (b * d / a))
x = d.zero? ? (c - (b * y)) / a : (f - e * y) / d
x = 0 if x.abs == 0.0
y = 0 if y.abs == 0.0
puts format('%.3f %.3f', x, y)
end
| [["+", 0, 662, 12, 754, 64, 738, 31, 739, 0, 24], ["+", 0, 662, 12, 754, 64, 738, 31, 739, 0, 25], ["+", 8, 170, 0, 751, 15, 738, 31, 652, 17, 131], ["+", 8, 170, 0, 751, 15, 738, 31, 652, 735, 22]] | 4 | 115 | 6 |
$stdin.each do |s|
a, b, c, d, e, f = s.split(' ').map!(&:to_i)
z1 = b * d - e * a
z2 = c * d - f * a
y = z2 / z1
x = (-(b * y) + c) / a
printf("%.3f %.3f\n", x, y)
end
| $stdin.each do |s|
a, b, c, d, e, f = s.split(' ').map!(&:to_f)
z1 = b * d - e * a
z2 = c * d - f * a
y = z2 / z1
x = (-(b * y) + c) / a
printf("%.3f %.3f\n", x, y)
end
| [["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]] | 4 | 82 | 2 |
args = []
while line = gets
a, b, c, d, e, f = line.split.map(&:to_i)
y = (a * f - d * c) / (a * e - d * b)
x = (c - b * y) / a
puts "#{format('%.3f', x)} #{format('%.3f', y)}"
end
| args = []
while line = gets
a, b, c, d, e, f = line.split.map(&:to_f)
y = (a * f - d * c) / (a * e - d * b)
x = (c - b * y) / a
puts "#{format('%.3f', x)} #{format('%.3f', y)}"
end
| [["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]] | 4 | 86 | 2 |
# a1x + b1y = c1
# a2x + b2y = c2
require 'English'
def solve(a1, b1, c1, a2, b2, c2)
x = (c1 * b2 - c2 * b1) / (a1 * b2 - a2 * b1)
x = 0.0 if x == -0.0
y = (a1 * c2 - a2 * c1) / (a1 * b2 - a2 * b1)
y = 0.0 if y == -0.0
[x, y]
end
$DEFAULT_INPUT.each do |l|
a, b, c, d, e, f = l.split.map(&:to_f)
x, y = s... | # a1x + b1y = c1
# a2x + b2y = c2
require 'English'
def solve(a1, b1, c1, a2, b2, c2)
x = (c1 * b2 - c2 * b1) / (a1 * b2 - a2 * b1)
x = 0.0 if x == -0.0
y = (a1 * c2 - a2 * c1) / (a1 * b2 - a2 * b1)
y = 0.0 if y == -0.0
[x, y]
end
$DEFAULT_INPUT.each do |l|
a, b, c, d, e, f = l.split.map(&:to_f)
x, y = s... | [["-", 8, 736, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 8, 736, 0, 652, 3, 4, 0, 557, 0, 6]] | 4 | 143 | 2 |
require 'English'
require 'matrix'
while gets
a, b, c, d, e, f = $LAST_READ_LINE.split(&:to_f)
v = Matrix[[a, b], [d, e]].inverse * Vector[c, f]
printf("%.3f %.3f\n", *v)
end
| require 'English'
require 'matrix'
while gets
a, b, c, d, e, f = $LAST_READ_LINE.split.map(&:to_f)
v = Matrix[[a, b], [d, e]].inverse * Vector[c, f]
printf("%.3f %.3f\n", *v)
end
| [["+", 0, 89, 8, 170, 0, 662, 12, 652, 17, 131], ["+", 0, 89, 8, 170, 0, 662, 12, 652, 735, 22]] | 4 | 65 | 2 |
$stdout.sync = true
num = []
while data = $stdin.gets
num = data.split.map!(&:to_i)
y = (num[2] * num[3] - num[0] * num[5]) / (num[1] * num[3] - num[0] * num[4])
x = (num[2] - num[1] * y) / num[0]
puts format("%.3f %.3f\n", x, y)
end
| $stdout.sync = true
num = []
while data = $stdin.gets
num = data.split.map!(&:to_f)
y = (num[2] * num[3] - num[0] * num[5]) / (num[1] * num[3] - num[0] * num[4])
x = (num[2] - num[1] * y) / num[0]
puts format('%.3f %.3f', x, y)
end
| [["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 62], ["+", 3, 4, 0, 652, 3, 4, 0, 557, 0, 62], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 44]] | 4 | 104 | 7 |
$stdin.each_line do |line|
a, b, c, d, e, f = line.split.map(&:to_f)
x = (b * f - a * c) / (b * d - a * e)
y = (c - a * x) / b
puts format('%.03f %.03f', x + 0.0, y + 0.0)
end
| $stdin.each_line do |line|
a, b, c, d, e, f = line.split.map(&:to_f)
x = (b * f - c * e) / (b * d - a * e)
y = (c - a * x) / b
puts format('%.3f %.3f', x + 0.0, y + 0.0)
# puts "#{sprintf("%.3f",x)} #{sprintf("%.3f",y)}"
end
| [["-", 12, 738, 31, 739, 0, 738, 12, 738, 31, 22], ["-", 12, 738, 31, 739, 0, 738, 12, 738, 17, 48], ["+", 12, 738, 31, 739, 0, 738, 12, 738, 17, 48], ["+", 12, 738, 31, 739, 0, 738, 12, 738, 12, 22], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6]] | 4 | 76 | 6 |
$stdin.each_line do |line|
a, b, c, d, e, f = line.split.map(&:to_f)
x = (b * f - a * c) / (b * d - a * e)
y = (c - a * x) / b
puts format('%.03f %.03f', x + 0.0, y + 0.0)
end
| $stdin.each_line do |line|
a, b, c, d, e, f = line.split.map(&:to_f)
x = (b * f - c * e) / (b * d - a * e)
y = (c - a * x) / b
puts format('%.3f %.3f', x + 0.0, y + 0.0)
end
| [["-", 12, 738, 31, 739, 0, 738, 12, 738, 31, 22], ["-", 12, 738, 31, 739, 0, 738, 12, 738, 17, 48], ["+", 12, 738, 31, 739, 0, 738, 12, 738, 17, 48], ["+", 12, 738, 31, 739, 0, 738, 12, 738, 12, 22], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6]] | 4 | 76 | 6 |
while line = gets
a, b, c, d, e, f = line.split.map(&:to_f)
det = (a * e - b * d) / 1000.0
printf "%.3f %.3f\n", ((c * e - b * f) / det).round / 1000.0, ((a * f - c * d) / det).round / 1000
end
| while line = gets
a, b, c, d, e, f = line.split.map(&:to_f)
det = (a * e - b * d) / 1000.0
printf "%.3f %.3f\n", ((c * e - b * f) / det).round / 1000.0, ((a * f - c * d) / det).round / 1000.0
end
| [["-", 8, 170, 0, 652, 3, 4, 0, 738, 12, 612], ["+", 8, 170, 0, 652, 3, 4, 0, 738, 12, 531]] | 4 | 80 | 2 |
require 'English'
while $stdin.gets
a, b, c, d, e, f = $LAST_READ_LINE.split(' ').map(&:to_i)
//
ratio = d.to_i / a
aa = a * ratio
bb = b * ratio
cc = c * ratio
coe_y = bb - e
right = cc - f
y = right / coe_y
//
coe_x = a
right = c - b * y
x = right / coe_x
puts format('%.3f %.3f', x, y)... | require 'English'
while $stdin.gets
a, b, c, d, e, f = $LAST_READ_LINE.split(' ').map(&:to_i)
//
ratio = d.to_f / a
aa = a * ratio
bb = b * ratio
cc = c * ratio
coe_y = bb - e
right = cc - f
y = right / coe_y
//
coe_x = a
right = c - b * y
x = right / coe_x
puts format('%.3f %.3f', x, y)... | [["-", 8, 170, 0, 662, 12, 738, 31, 652, 735, 22], ["+", 8, 170, 0, 662, 12, 738, 31, 652, 735, 22]] | 4 | 102 | 2 |
def getX(a, b, c, d, e, f)
denominator = a * e - b * d
numerator = c * e - b * f
x = numerator / denominator
x = 0.0 if x == -0.0
x
end
def getY(a, b, c, d, e, f)
denominator = b * d - a * e
numerator = c * d - a * f
y = numerator / denominator
y = 0.0 if y == -0.0
y
end
f = Array.new(6)
while in... | def getX(a, b, c, d, e, f)
denominator = a * e - b * d
numerator = c * e - b * f
x = numerator / denominator
x = 0.0 if x == -0.0
x
end
def getY(a, b, c, d, e, f)
denominator = b * d - a * e
numerator = c * d - a * f
y = numerator / denominator
y = 0.0 if y == -0.0
y
end
f = Array.new(6)
while in... | [["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6]] | 4 | 220 | 2 |
require 'matrix'
def solve(line)
a = Matrix[[line[0].to_f, line[1].to_f], [line[3].to_f, line[4].to_f]]
p a
b = Vector[line[2].to_f, line[5].to_f]
p b
s = a.inv * b
s.to_a
end
inputs = []
while (line = gets) != nil
inputs.push(line.split)
end
inputs.each do |i|
s = solve(i)
puts printf('%#0.3f %#0... | require 'matrix'
def solve(line)
a = Matrix[[line[0].to_f, line[1].to_f], [line[3].to_f, line[4].to_f]]
b = Vector[line[2].to_f, line[5].to_f]
s = a.inv * b
s.to_a
end
inputs = []
while (line = gets) != nil
inputs.push(line.split)
end
inputs.each do |i|
s = solve(i)
puts printf('%#0.3f %#0.3f', s[0], ... | [["-", 0, 493, 0, 735, 8, 736, 0, 652, 735, 22], ["-", 0, 735, 8, 736, 0, 652, 3, 4, 0, 22]] | 4 | 130 | 4 |
while tmp = gets
a, b, c, d, e, f = tmp.split.map(&:to_i)
printf("%.3f %.3f\n", 1e-9 + 1.*(c * e - b * f) / (a * e - b * d), 1e-9 + 1.*(a * f - c * d) / (a * e - b * d))
end
| while tmp = gets
a, b, c, d, e, f = tmp.split.map(&:to_f)
puts format('%.3f %.3f', 1e-9 + 1.*(c * e - b * f) / (a * e - b * d), 1e-9 + 1.*(a * f - c * d) / (a * e - b * d))
end
| [["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["-", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22], ["+", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22], ["+", 8, 170, 0, 652, 3, 4, 0, 652, 735, 22], ["-", 8, 170, 0, 652, 3, 4, 0, 557, 0, 62], ["+", 3, 4, 0, 652, 3, 4, 0, 557, 0, 62], [... | 4 | 83 | 10 |
def f(line)
a, b, c, d, e, f = line.split(' ').map(&:to_i)
y = (a * f - d * c) / (a * e - d * b)
x = (c - b * y) / a
format('%.3f %.3f', x, y)
end
while line = gets
puts f(line)
end
| def f(line)
a, b, c, d, e, f = line.split(' ').map(&:to_f)
y = (a * f - d * c) / (a * e - d * b)
x = (c - b * y) / a
format('%.3f %.3f', x, y)
end
while line = gets
puts f(line)
end
| [["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]] | 4 | 84 | 2 |
$stdin.each do |value|
a, b, c, d, e, f = value.split.map(&:to_i)
y = ((e * c - b * f) * 1.0 / (a * e - b * d) * 1000).round / 1000.0
x = ((a * f - d * c) * 1.0 / (a * e - b * d) * 1000).round / 1000.0
puts format('%.3f %.3f', x.to_f, y.to_f)
end
| $stdin.each do |value|
a, b, c, d, e, f = value.split.map(&:to_i)
x = ((e * c - b * f) * 1.0 / (a * e - b * d) * 1000).round / 1000.0
y = ((a * f - d * c) * 1.0 / (a * e - b * d) * 1000).round / 1000.0
puts format('%.3f %.3f', x.to_f, y.to_f)
end
| [["-", 0, 652, 196, 737, 8, 736, 0, 662, 31, 22], ["+", 0, 652, 196, 737, 8, 736, 0, 662, 31, 22]] | 4 | 106 | 4 |
while set = gets
break if set.nil? || (set == "\n") || (set == "\n\r")
a, b, c, d, e, f = set.split.map(&:to_f)
y = (d * c - a * f) / (d * b - a * e)
x = (c - b * y) / a
printf('%.3f %.3f', x, y)
end
| while set = gets
break if set.nil? || (set == "\n") || (set == "\n\r")
a, b, c, d, e, f = set.split.map(&:to_f)
y = (d * c - a * f) / (d * b - a * e)
x = (c - b * y) / a
printf("%.3f %.3f\n", x, y)
end
| [["-", 8, 170, 0, 652, 3, 4, 0, 557, 0, 62], ["+", 8, 170, 0, 652, 3, 4, 0, 557, 0, 62], ["+", 8, 170, 0, 652, 3, 4, 0, 557, 0, 44]] | 4 | 90 | 5 |
#include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
typedef unsigned long ul;
using namespace std;
int main() {
int len;
string str;
cin >> str;
len = str.length();
for (int i = len - 1; i >= 0; i--) {
cout << str.at(i)... | #include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
typedef unsigned long ul;
using namespace std;
int main() {
int len;
string str;
cin >> str;
len = str.length();
for (int i = len - 1; i >= 0; i--) {
cout << str.at(i)... | [["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]] | 1 | 76 | 4 |
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <utility>
using namespace std;
int main() {
int i, j;
char str[20] = {};
for (i = 0; cin >> str[i]; i++) {
}
for (j = i - 1; j >= 0; j--) {
cout << str[j] << endl;
}
return 0;
} | #include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <utility>
using namespace std;
int main() {
int i, j;
char str[20] = {};
for (i = 0; cin >> str[i]; i++) {
}
for (j = i - 1; j >= 0; j--) {
cout << str[j];
}
cout << endl;
return 0;
} | [["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]] | 1 | 81 | 4 |
#include <iostream>
#include <string>
using namespace std;
int main() {
char a;
string str;
cin >> str;
for (int i = 0; i != str.size() - 1 - i; i++) {
a = str[i];
str[i] = str[str.size() - 1 - i];
str[str.size() - 1 - i] = a;
}
cout << str << endl;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
char a;
string str;
cin >> str;
for (int i = 0; i < str.size() - 1 - i; i++) {
a = str[i];
str[i] = str[str.size() - 1 - i];
str[str.size() - 1 - i] = a;
}
cout << str << endl;
} | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 79], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]] | 1 | 94 | 2 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) for (int(i) = 0; (i) < (int)(n); (i)++)
#define REMOVE(Itr, n) ... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) for (int(i) = 0; (i) < (int)(n); (i)++)
#define REMOVE(Itr, n) ... | [["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 105 | 4 |
#include <iostream>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = str.length() - 1; i >= 0; i--)
cout << str[i];
cout << NULL;
return 0;
} | #include <iostream>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = str.length() - 1; i >= 0; i--)
cout << str[i];
cout << endl;
return 0;
} | [["-", 8, 9, 0, 1, 0, 16, 12, 144, 0, 145], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 53 | 2 |
#include <stdio.h>
int main() {
int n = 0;
char a[1000];
for (int i = 0; i < 1000; i++)
a[i] = '\0';
scanf("%s", a);
while (a[n] != '\0')
n++;
for (int i = n - 1; i >= 0; i++)
printf("%c", a[i]);
printf("\n");
} | #include <stdio.h>
int main() {
int n = 0;
char a[1000];
for (int i = 0; i < 1000; i++)
a[i] = '\0';
scanf("%s", a);
while (a[n] != '\0')
n++;
for (int i = n - 1; i >= 0; i--)
printf("%c", a[i]);
printf("\n");
} | [["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68]] | 1 | 100 | 2 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
reverse(s.begin(), s.end());
cout << s << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
reverse(s.begin(), s.end());
cout << s << endl;
return 0;
}
| [["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 39 | 4 |
#include <iostream>
#include <string.h>
using namespace std;
int main() {
char bun[25] = {};
int len;
cin >> bun;
len = strlen(bun);
for (int i = len - 1; i > 0; i--) {
cout << bun[i];
}
cout << endl;
return 0;
}
| #include <iostream>
#include <string.h>
using namespace std;
int main() {
char bun[25] = {};
int len;
cin >> bun;
len = strlen(bun);
for (int i = len - 1; i >= 0; i--) {
cout << bun[i];
}
cout << endl;
return 0;
}
| [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20]] | 1 | 69 | 2 |
#include <stdio.h>
int main(void) {
int i = 0, j;
char str, ch[21];
while (scanf("%c", &str) != EOF) {
ch[i] = str;
// printf("%c",ch[i]);
i++;
}
for (j = i - 3; j >= 0; j--) {
printf("%c", ch[j]);
}
printf("\n");
return 0;
} | #include <stdio.h>
int main(void) {
int i = 0, j;
char str, ch[21];
while (scanf("%c", &str) != EOF) {
ch[i] = str;
// printf("%c",ch[i]);
i++;
}
for (j = i - 2; j >= 0; j--) {
printf("%c", ch[j]);
}
printf("\n");
return 0;
} | [["-", 8, 9, 0, 7, 10, 11, 12, 16, 12, 13], ["+", 8, 9, 0, 7, 10, 11, 12, 16, 12, 13]] | 0 | 90 | 2 |
#include <stdio.h>
int main() {
char str[21], henkan[21];
int i = 0, j = 0;
scanf("%s", str);
while (str[i]) {
i++;
}
henkan[i] = '\0';
i--;
while (henkan[j]) {
henkan[j] = str[i];
i--;
j++;
}
printf("%s\n", henkan);
return 0;
} | #include <stdio.h> /*gets(),puts()¾ÆRpCG[ÆWbW³ê½H*/
int main() {
char str[21],
henkan
[21]; /*20¶ÈàÅAÅãÉÍ'\0'ªÜÜêéÌÅ*/
int i = 0, j = 0;
scanf("%s", str);
while (str[i]) { /*¶ñÌ·³Í¢ç©ÈH*/
i++;
}
henkan[i] = '\0'; /*¶ñÌ·³ðw... | [["-", 8, 9, 0, 52, 15, 23, 0, 69, 28, 22], ["+", 8, 9, 0, 52, 15, 23, 0, 69, 28, 22], ["-", 8, 9, 0, 1, 0, 11, 31, 69, 71, 22], ["+", 8, 9, 0, 1, 0, 11, 31, 69, 71, 22], ["-", 8, 9, 0, 1, 0, 11, 12, 69, 71, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 69, 71, 22]] | 0 | 99 | 6 |
#include <stdio.h>
int main() {
char str[20], stra[20];
int i, c = 0;
scanf("%s", &str);
while (1) {
stra[c] = str[c];
if (str[c] == '\0') {
break;
}
c++;
}
for (i = 0; i < c; i++) {
str[i] = stra[c - 1 - i];
}
stra[c] = '\0';
printf("%sbus\n", str);
return 0;
} | #include <stdio.h>
int main() {
char str[21], stra[21];
int i, c = 0;
scanf("%s", &str);
while (1) {
stra[c] = str[c];
if (str[c] == '\0') {
break;
}
c++;
}
for (i = 0; i < c; i++) {
str[i] = stra[c - 1 - i];
}
stra[c] = '\0';
printf("%s\n", str);
return 0;
} | [["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 121 | 6 |
#include <stdio.h>
void put_rstring(const char str[]) {
unsigned length = 0;
while (str[length])
length++;
for (; length > 0; length--)
putchar(str[length - 1]);
}
int main() {
char str[21];
scanf("%s", str);
put_rstring(str);
printf("%s\n", str);
return 0;
} | #include <stdio.h>
void put_rstring(const char str[]) {
unsigned length = 0;
while (str[length])
length++;
for (; length > 0; length--)
putchar(str[length - 1]);
}
int main() {
char str[21];
scanf("%s", str);
put_rstring(str);
putchar('\n');
return 0;
} | [["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 103, 0, 104], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 0 | 87 | 9 |
#include "stdio.h"
#include "string.h"
int main() {
char str[22];
int i = 0;
int flag = 0;
memset(str, '0', 22);
fgets(str, sizeof(str - 1), stdin);
for (i = 20, flag = 0; i >= 0; i--) {
if (str[i] == 0) {
flag++;
} else if (flag == 1 && str[i] != 10) {
printf("%c", str[i]);
}
... | #include "stdio.h"
#include "string.h"
int main() {
char str[21];
int i = 0;
int flag = 0;
memset(str, '0', 21);
fgets(str, sizeof(str), stdin);
for (i = 20, flag = 0; i >= 0; i--) {
if (str[i] == 0) {
flag++;
} else if (flag == 1 && str[i] != 10) {
printf("%c", str[i]);
}
}
... | [["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 3, 4, 0, 105, 51, 23, 0, 16, 17, 33], ["-", 3, 4, 0, 105, 51, 23, 0, 16, 12, 13]] | 0 | 126 | 6 |
#include <iostream>
#include <string>
using namespace std;
int main(void) {
string str;
cin >> str;
for (int i = str.size() - 1; i <= 0; i--)
cout << str[i];
cout << endl;
} | #include <iostream>
#include <string>
using namespace std;
int main(void) {
string str;
cin >> str;
for (int i = str.size() - 1; i >= 0; i--)
cout << str[i];
cout << endl;
} | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20]] | 1 | 53 | 2 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string str;
while (1) {
cin >> str;
if (cin.eof())
break;
for (int i = (str.size() - 1); i > 0; i--)
cout << str[i];
cout << endl;
}
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
while (1) {
cin >> str;
if (cin.eof())
break;
for (int i = (str.size() - 1); i >= 0; i--)
cout << str[i];
cout << endl;
}
return 0;
} | [["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 20]] | 1 | 73 | 2 |
#include <stdio.h>
#include <string.h>
int main() {
char str[21] = {};
char ch;
int n;
scanf("%s", str);
n = strlen(str);
for (int i = 0; i < n; i++) {
printf("%c", str[n - 1]);
}
printf("\n");
return 0;
} | #include <stdio.h>
#include <string.h>
int main() {
char str[21] = {};
char ch;
int n;
scanf("%s", str);
n = strlen(str);
for (int i = 0; i < n; i++) {
printf("%c", str[n - i - 1]);
}
printf("\n");
return 0;
} | [["+", 0, 69, 341, 342, 0, 16, 31, 16, 12, 22], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 17, 33]] | 1 | 81 | 2 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = str.size() - 1; i >= 0; i++)
cout << str[i];
cout << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = str.size() - 1; i >= 0; i--)
cout << str[i];
cout << endl;
return 0;
} | [["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68]] | 1 | 55 | 2 |
#include <iostream>
#include <stdio.h>
int main() {
int i;
char s[21];
scanf("&s", s);
for (i = 0; s[i] != '\0'; i++)
;
if (i > 0)
i--;
for (; i >= 0; i--)
std::cout << s[i];
std::cout << std::endl;
return 0;
} | #include <iostream>
#include <stdio.h>
int main() {
int i;
char s[21];
scanf("%s", s);
for (i = 0; s[i] != '\0'; i++)
;
if (i > 0)
i--;
for (; i >= 0; i--)
std::cout << s[i];
std::cout << std::endl;
return 0;
} | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 86 | 2 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = s.size() - 1; i >= 0; ++i)
cout << s[i];
cout << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = s.size() - 1; i >= 0; --i)
cout << s[i];
cout << endl;
}
| [["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68]] | 1 | 50 | 2 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
string s;
reverse(s.begin(), s.end());
cout << s << endl;
}
| #include <algorithm>
#include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
reverse(s.begin(), s.end());
cout << s << endl;
}
| [["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 38 | 4 |
#include <iostream>
using namespace std;
int main() {
string in, buf;
int f = 0, b;
cin >> in;
b = in.size() - 1;
while (b - f > 1) {
buf = in[f];
in[f] = in[b];
in[b] = buf[0];
f++;
b--;
}
cout << in << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
string in, buf;
int f = 0, b;
cin >> in;
b = in.size() - 1;
while (b - f >= 1) {
buf = in[f];
in[f] = in[b];
in[b] = buf[0];
f++;
b--;
}
cout << in << endl;
return 0;
} | [["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20]] | 1 | 90 | 2 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = s.size() - 1; i--;) {
cout << s[i];
}
cout << endl;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = s.size(); i--;) {
cout << s[i];
}
cout << endl;
} | [["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13]] | 1 | 51 | 2 |
#include <iostream>
using namespace std;
int main(void) {
string str;
cin >> str;
int l = str.size();
for (int i = l; i >= 0; i++) {
cout << str[i];
}
cout << endl;
return 0;
} | #include <iostream>
using namespace std;
int main(void) {
string str;
cin >> str;
int l = str.size();
for (int i = l; i > 0; i--) {
cout << str[i - 1];
}
cout << endl;
return 0;
} | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68], ["+", 0, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 16, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 59 | 6 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = str.size(); i > 0; --i)
cout << str[i - 1] << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = str.size(); i > 0; --i)
cout << str[i - 1];
cout << endl;
return 0;
} | [["+", 0, 14, 8, 9, 0, 7, 8, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22]] | 1 | 53 | 2 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = str.size() - 1; i >= 0; i++) {
cout << str[i];
}
cout << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = str.size() - 1; i >= 0; i--) {
cout << str[i];
}
cout << endl;
return 0;
} | [["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68]] | 1 | 57 | 2 |
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
main() {
string str;
cin >> str;
for (int i = str.size() - 1; i >= 0; --i)
cout << str[i] << endl;
} | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
main() {
string str;
cin >> str;
for (int i = str.size() - 1; i >= 0; --i)
cout << str[i];
cout << endl;
} | [["+", 0, 14, 8, 9, 0, 7, 8, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22]] | 1 | 51 | 2 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string A;
char R;
cin >> A;
for (int i = 0; i <= A.length() / 2; i++) {
R = A[i];
A[i] = A[A.length() - i - 1];
A[A.length() - i - 1] = R;
}
cout << A << "\n";
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string A;
char R;
cin >> A;
for (int i = 0; i < A.length() / 2; i++) {
R = A[i];
A[i] = A[A.length() - i - 1];
A[A.length() - i - 1] = R;
}
cout << A << "\n";
return 0;
} | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]] | 1 | 97 | 2 |
#include <iostream>
#include <string.h>
using namespace std;
int main() {
char a[20];
cin >> a;
for (int i = strlen(a) - 1; i > 0; i--) {
cout << a[i] << endl;
}
return 0;
} | #include <iostream>
#include <string.h>
using namespace std;
int main() {
char a[20];
cin >> a;
for (int i = strlen(a) - 1; i >= 0; i--) {
cout << a[i];
}
cout << endl;
return 0;
} | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]] | 1 | 57 | 6 |
#include <stdio.h>
#include <string.h>
int main(void) {
char str[20];
scanf("%s", str);
for (int i = strlen(str) - 1; i > 0; i--)
printf("%s", str[i - 1]);
printf("\n");
return 0;
} | #include <stdio.h>
#include <string.h>
int main(void) {
char str[20];
scanf("%s", str);
for (int i = strlen(str) - 1; i >= 0; i--) {
printf("%c", str[i]);
}
printf("\n");
return 0;
} | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45], ["-", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 3, 4, 0, 69, 341, 342, 0, 16, 17, 33], ["-", 3, 4, 0, 69, 341, 342, 0, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0... | 1 | 69 | 8 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = s.size() - 1; i > 0; i--) {
cout << s[i];
}
cout << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = s.size() - 1; i >= 0; i--) {
cout << s[i];
}
cout << endl;
return 0;
} | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20]] | 1 | 57 | 2 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 1; i < s.length(); i++) {
cout << s[s.length() - i];
}
cout << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 1; i < s.length() + 1; i++) {
cout << s[s.length() - i];
}
cout << endl;
return 0;
} | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 61 | 2 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String moji;
char[] charmoji;
while (scan.hasNext() == true) {
moji = scan.next();
charmoji = moji.toCharArray();
for (int i = 0; i < charmoji.length; i++)... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String moji;
char[] charmoji;
while (scan.hasNext() == true) {
moji = scan.next();
charmoji = moji.toCharArray();
for (int i = 0; i < charmoji.length / 2; ... | [["+", 8, 196, 0, 7, 15, 16, 12, 16, 17, 85], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499], ["-", 8, 196, 0, 503, 49, 200, 51, 504, 71, 499], ["+", 8, 196, 0, 503, 49, 200, 51, 504, 71, 22], ["-", 8, 196, 0, 1, 0, 11, 31, 504, 71, 499], ["+", 8, 196, 0, 1, 0, 11, 31, 504, 71, 22]] | 3 | 150 | 6 |
import java.util.Scanner;
public class Main {
Scanner sc = new Scanner(System.in);
void run() {
char c[] = sc.next().toCharArray();
int l = c.length;
while (l-- != 0) {
System.out.print(c[l]);
System.out.println();
}
}
public static void main(String[] args) { new Main().run(); }
} | import java.util.Scanner;
public class Main {
Scanner sc = new Scanner(System.in);
void run() {
char c[] = sc.next().toCharArray();
int l = c.length;
while (l-- != 0) {
System.out.print(c[l]);
}
System.out.println();
}
public static void main(String[] args) { new Main().run(); }
} | [["+", 0, 195, 8, 196, 0, 52, 8, 196, 0, 46], ["-", 0, 195, 8, 196, 0, 52, 8, 196, 0, 46]] | 3 | 101 | 2 |
#include <stdio.h>
#include <string.h>
int main(void) {
char *s;
int i;
scanf("%s", s);
int len = strlen(s);
for (i = len - 1; i >= 0; i--)
putchar(s[i]);
putchar('\n');
return 0;
} | #include <stdio.h>
#include <string.h>
int main(void) {
char s[21];
int i;
scanf("%s", s);
int len = strlen(s);
for (i = len - 1; i >= 0; i--)
putchar(s[i]);
putchar('\n');
return 0;
} | [["-", 0, 14, 8, 9, 0, 43, 49, 84, 0, 48], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 0, 70], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 0, 73]] | 0 | 68 | 4 |
#include <stdio.h>
#include <string.h>
int main() {
char a[21];
int i = 0;
scanf("%s", a);
i = strlen(a);
i--;
while (i != 0) {
printf("%c", a[i]);
i--;
}
printf("\n");
return 0;
} | #include <stdio.h>
#include <string.h>
int main() {
char a[21];
int i = 0;
scanf("%s", a);
i = strlen(a);
i--;
while (i >= 0) {
printf("%c", a[i]);
i--;
}
printf("\n");
return 0;
} | [["-", 8, 9, 0, 52, 15, 23, 0, 16, 17, 79], ["+", 8, 9, 0, 52, 15, 23, 0, 16, 17, 20]] | 0 | 73 | 2 |
#include <stdio.h>
#include <string.h>
int main(void) {
char str[25], temp;
int i, len;
scanf("%s", str);
len = strlen(str);
for (i = 0; i < len - 1; i++) {
temp = str[i];
str[i] = str[len - 1 - i];
str[len - 1 - i] = temp;
}
printf("%s\n", str);
return 0;
} | #include <stdio.h>
#include <string.h>
int main(void) {
char str[25], temp;
int i, len;
scanf("%s", str);
len = strlen(str);
for (i = 0; i <= (len - 1) / 2; i++) {
temp = str[i];
str[i] = str[len - 1 - i];
str[len - 1 - i] = temp;
}
printf("%s\n", str);
return 0;
} | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 7, 15, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 7, 15, 16, 12, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 85], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 0 | 102 | 6 |
#include <stdio.h>
#include <string.h>
int main() {
int i;
char str[21];
scanf("%c", str);
for (i = strlen(str) - 1; i >= 0; --i) {
putchar(str[i]);
}
printf("?\n");
return (0);
} | #include <stdio.h>
#include <string.h>
int main() {
int i;
char str[21];
scanf("%s", str);
for (i = strlen(str) - 1; i >= 0; --i) {
putchar(str[i]);
}
printf("\n");
return (0);
} | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 69 | 3 |
#include <stdio.h>
void inverse(char str[], char inv[]);
int main() {
char str[21], inv[21];
while (scanf("%c", str) != -1) {
inverse(str, inv);
printf("%s", inv);
}
return 0;
}
void inverse(char str[], char inv[]) {
int i, j;
for (i = 0; str[i] != '\0'; i++)
;
for (j = 0; j < i; j++) {
... | #include <stdio.h>
void inverse(char str[], char inv[]);
int main() {
char str[21], inv[21];
while (scanf("%s", str) != -1) {
inverse(str, inv);
printf("%s\n", inv);
}
return 0;
}
void inverse(char str[], char inv[]) {
int i, j;
for (i = 0; str[i] != '\0'; i++)
;
for (j = 0; j < i; j++) {
... | [["-", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 1, 0, 11, 12, 69, 71, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 69, 71, 16, 12, 13]] | 0 | 142 | 5 |
#include <stdio.h>
int main() {
char str[21];
int len;
int i;
char tmp;
scanf("%s", str);
len = strlen(str);
for (i = 0; i < len / 2; i++) {
tmp = str[i];
str[i] = str[len - 1 - i];
str[len - 1 - i] = tmp;
}
printf("%s\n");
return 0;
} | #include <stdio.h>
int main() {
char str[21];
int len;
int i;
char tmp;
scanf("%s", str);
len = strlen(str);
for (i = 0; i < len / 2; i++) {
tmp = str[i];
str[i] = str[len - 1 - i];
str[len - 1 - i] = tmp;
}
printf("%s\n", str);
return 0;
} | [["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 0 | 99 | 2 |
#include <stdio.h>
#include <string.h>
int main(void) {
int i = 0;
char text[20] = {};
char x;
scanf("%s", text);
while (i < (strlen(text) - 1) / 2) {
x = text[i];
text[i] = text[strlen(text) - 1 - i];
text[strlen(text) - 1 - i] = x;
i++;
}
printf("%s\n", text);
return (0);
} | #include <stdio.h>
#include <string.h>
int main(void) {
int i = 0;
char text[20] = {};
char x;
scanf("%s", text);
while (i <= (strlen(text) - 1) / 2) {
x = text[i];
text[i] = text[strlen(text) - 1 - i];
text[strlen(text) - 1 - i] = x;
i++;
}
printf("%s\n", text);
return (0);
} | [["-", 8, 9, 0, 52, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 52, 15, 23, 0, 16, 17, 19]] | 0 | 110 | 2 |
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#define U1 unsigned char
#define S1 char
#define S4 int
#define MAX_LENGTH (21) /* ヌル文字込みの最大入力文字数 */
S4 main() {
U1 u1_tp_input[MAX_LENGTH]; /* 反転したい文字列 */
S1 s1_t_idx; /* 文字列反転処理で処理中の文字を指すインデックス */
U1 u1_t_strLength; /* 文字列の長さ */
/* 入力 ... | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#define U1 unsigned char
#define S1 char
#define S4 int
#define MAX_LENGTH (21) /* ヌル文字込みの最大入力文字数 */
S4 main() {
U1 u1_tp_input[MAX_LENGTH]; /* 反転したい文字列 */
S1 s1_t_idx; /* 文字列反転処理で処理中の文字を指すインデックス */
U1 u1_t_strLength; /* 文字列の長さ */
/* 入力 ... | [["-", 0, 14, 8, 9, 0, 1, 0, 74, 0, 24], ["-", 8, 9, 0, 1, 0, 74, 39, 77, 39, 40], ["-", 0, 14, 8, 9, 0, 1, 0, 74, 0, 25], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47]] | 0 | 120 | 5 |
#include <stdio.h>
#include <string.h>
int main() {
char buff[1024];
char result[1024];
int length;
fgets(buff, 1024, stdin);
length = strlen(buff);
int i, j;
for (i = length - 3, j = 0; i >= 0; i--, j++) {
result[j] = buff[i];
}
result[j] = '\0';
printf("%s\n", result);
return 0;
}
| #include <stdio.h>
#include <string.h>
int main() {
char buff[64];
char result[64];
int length;
fgets(buff, 64, stdin);
length = strlen(buff);
int i, j;
for (i = length - 2, j = 0; i >= 0; i--, j++) {
result[j] = buff[i];
}
result[j] = '\0';
printf("%s\n", result);
return 0;
}
| [["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 7, 10, 34, 31, 11, 12, 16, 12, 13], ["+", 0, 7, 10, 34, 31, 11, 12, 16, 12, 13]] | 0 | 102 | 8 |
#include <stdio.h>
#include <string.h>
int main(void) {
char str[100];
scanf("%s", str);
int len = strlen(str);
while (len-- != 0) {
printf("%c", str[len]);
puts("");
}
return 0;
}
| #include <stdio.h>
#include <string.h>
int main(void) {
char str[100];
scanf("%s", str);
int len = strlen(str);
while (len-- != 0) {
printf("%c", str[len]);
}
puts("");
return 0;
}
| [["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]] | 0 | 64 | 2 |
main(i) { i - 10 && main(getc(0)) & putchar(i - 1 ? i : 10); } | main(i) { return i - 10 && main(getchar()) & putchar(i - 1 ? i : 10); } | [["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["-", 12, 16, 31, 2, 3, 4, 0, 2, 63, 22], ["+", 12, 16, 31, 2, 3, 4, 0, 2, 63, 22], ["-", 31, 2, 3, 4, 0, 2, 3, 4, 0, 13]] | 0 | 29 | 5 |
i = 20;
char s[];
main(i) {
scanf("%s", s);
for (; i;)
putchar(s[--i]);
i = !puts("");
} | i = 20;
char s[20];
main() {
scanf("%s", s);
for (; i;)
putchar(s[--i]);
i = !puts("");
} | [["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 36, 36, 0, 30, 0, 14, 49, 65, 0, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]] | 0 | 48 | 8 |
i = 20;
char s[];
main(i) {
scanf("%s", s);
for (; i;)
putchar(s[--i]);
i = !puts("");
} | i = 20;
char s[20];
main() {
scanf("%s", s);
for (; i;)
putchar(s[--i]);
i = !putchar(10);
} | [["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 36, 36, 0, 30, 0, 14, 49, 65, 0, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35], ["-", 0, 1, 0, 11, 12, 91, 28, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 91, 28, 2, 63, 22], ["-", 12, 91, 28, 2, 3, 4, 0, 5, 0, 62], ["+", 0, 11, 12, 91, 28, 2, 3, 4, 0, 13]] | 0 | 48 | 8 |
b[99];
main(i, j) {
for (i = 0; (j = ~getchar()) ? b[i++] = j
: i ? putchar(~b[--i])
: !puts("");
b[i - 1] - ~10 && i--)
;
} | b[99];
main(i, j) {
for (i = 0; (j = ~getchar()) ? b[i++] = j
: i ? putchar(~b[--i])
: !puts("");
b[i - 1] - ~10 || i--)
;
} | [["-", 0, 30, 0, 9, 0, 7, 26, 16, 17, 98], ["+", 0, 30, 0, 9, 0, 7, 26, 16, 17, 106]] | 0 | 70 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.