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 <iostream>
using namespace std;
int main() {
char tmp = 'A', cup1, cup2, t;
while (cin >> cup1 >> t >> cup2) {
if (cup1 == tmp)
tmp = cup2;
if (cup2 == tmp)
tmp = cup1;
}
cout << tmp << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
char tmp = 'A', cup1, cup2, t;
while (cin >> cup1 >> t >> cup2) {
if (cup1 == tmp)
tmp = cup2;
else if (cup2 == tmp)
tmp = cup1;
}
cout << tmp << endl;
return 0;
} | [["+", 0, 52, 8, 9, 0, 57, 75, 76, 0, 95]] | 1 | 66 | 1 |
hash = {"A" => 1, "B" => 0, "C" => 0}
choice = []
while tmp = gets
tmp = tmp.split(",").map(&:chomp)
p cng1 = hash[tmp[1]]
p cng2 = hash[tmp[0]]
p hash[tmp[0]] = cng1
p hash[tmp[1]] = cng2
p hash
end
puts hash.select{|_,v| v == hash.values.max}.keys
| hash = {"A" => 1, "B" => 0, "C" => 0}
choice = []
while tmp = gets
tmp = tmp.split(",").map(&:chomp)
cng1 = hash[tmp[1]]
cng2 = hash[tmp[0]]
hash[tmp[0]] = cng1
hash[tmp[1]] = cng2
hash
end
puts hash.select{|_,v| v == hash.values.max}.keys
| [["-", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22]] | 4 | 108 | 5 |
#encoding:utf-8 No.0047 2014.10.6
cups = {"A"=>"ball","B"=>nil,"C"=>nil}
change = []
while gets
change.push gets.chomp.split(/,/)
end
change.length.times do |i|
cups[change[i][0]],cups[change[i][1]] = cups[change[i][1]],cups[change[i][0]]
end
cups.each{|key,value|
puts key if value == "ball"
} | #encoding:utf-8 No.0047 2014.10.6
cups = {"A"=>"ball","B"=>nil,"C"=>nil}
change = []
while gets
change.push $_.chomp.split(/,/)
end
change.length.times do |i|
cups[change[i][0]],cups[change[i][1]] = cups[change[i][1]],cups[change[i][0]]
end
cups.each{|key,value|
puts key if value == "ball"
} | [["-", 0, 652, 3, 4, 0, 652, 486, 652, 486, 22], ["+", 0, 652, 3, 4, 0, 652, 486, 652, 486, 744]] | 4 | 115 | 2 |
def ball(c1, c2, b)
case b
when c1
return c2
when c2
return c1
else
return b
end
end
b = "A"
while line = gets
cup1, cup2 = line.chomp.split(",")
p b = ball(cup1, cup2, b)
end
puts b | def ball(c1, c2, b)
case b
when c1
return c2
when c2
return c1
else
return b
end
end
b = "A"
while line = gets
cup1, cup2 = line.chomp.split(",")
b = ball(cup1, cup2, b)
end
puts b | [["-", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22]] | 4 | 61 | 9 |
cup = [1,0,0]
while act = gets
case act.chomp
when "A,B" then cup[0], cup[1] = cup[1], cup[0]
when "B,A" then cup[0], cup[1] = cup[1], cup[0]
when "A,C" then cup[0], cup[2] = cup[2], cup[0]
when "C,A" then cup[0], cup[2] = cup[2], cup[0]
when "B,C" then cup[1], cup[2] = cup[2], cup[1]
when "C,B" then cup... | cup = [1,0,0]
while act = gets
case act.chomp
when "A,B" then cup[0], cup[1] = cup[1], cup[0]
when "B,A" then cup[0], cup[1] = cup[1], cup[0]
when "A,C" then cup[0], cup[2] = cup[2], cup[0]
when "C,A" then cup[0], cup[2] = cup[2], cup[0]
when "B,C" then cup[1], cup[2] = cup[2], cup[1]
when "C,B" then cup... | [["-", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22], ["-", 0, 89, 8, 170, 0, 652, 3, 4, 0, 22]] | 4 | 194 | 2 |
cups = [1, 0, 0]
while line = gets
case line
when "A,B", "B,A"
cups[0], cups[1] = cups[1], cups[0]
when "A,C", "C,A"
cups[0], cups[2] = cups[2], cups[0]
when "B,C", "C,B"
cups[1], cups[2] = cups[2], cups[1]
end
end
ABC = "ABC"
puts "ABC"[cups.index{|cup| cup == 1}] | cups = [1, 0, 0]
while line = gets
case line.chomp!
when "A,B", "B,A"
cups[0], cups[1] = cups[1], cups[0]
when "A,C", "C,A"
cups[0], cups[2] = cups[2], cups[0]
when "B,C", "C,B"
cups[1], cups[2] = cups[2], cups[1]
end
end
ABC = "ABC"
puts "ABC"[cups.index{|cup| cup == 1}] | [["+", 0, 89, 8, 170, 0, 173, 51, 652, 17, 131], ["+", 0, 89, 8, 170, 0, 173, 51, 652, 735, 22]] | 4 | 120 | 2 |
from math import *
PI = 3.1415926535898
base = "A"
while True:
try:
x, y = list(map(str, input().strip().split(',')))
if x == base:
base = y
if y == base:
base = x
except EOFError:
break
print(base) | from math import *
PI = 3.1415926535898
base = "A"
while True:
try:
x, y = list(map(str, input().strip().split(',')))
if x == base:
base = y
elif y == base:
base = x
except EOFError:
break
print(base) | [["-", 8, 196, 0, 246, 8, 196, 0, 57, 0, 121], ["+", 0, 246, 8, 196, 0, 57, 75, 665, 0, 683]] | 5 | 67 | 2 |
d = {"A":1, "B":0, "C":0}
while True:
try:
swap1, awap2 = input().split(",")
d[swap1], d[swap2] = d[swap2], d[swap1]
except:
break
print(list(d.keys())[list(d.values()).index(1)])
| d = {"A":1, "B":0, "C":0}
while True:
try:
swap1, swap2 = input().split(",")
d[swap1], d[swap2] = d[swap2], d[swap1]
except:
break
print(list(d.keys())[list(d.values()).index(1)])
| [["-", 8, 196, 0, 1, 0, 662, 31, 684, 0, 22], ["+", 8, 196, 0, 1, 0, 662, 31, 684, 0, 22]] | 5 | 88 | 2 |
import sys
c='ABC'
for e in sys.stdin:c.replace(e[0],'D').replace(e[2],e[0]).replace('D',e[2])
print(c[0])
| import sys
c='ABC'
for e in sys.stdin:c=c.replace(e[0],'D').replace(e[2],e[0]).replace('D',e[2])
print(c[0])
| [["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 500, 652, 63, 319, 500, 652, 63, 319, 500, 22]] | 5 | 59 | 2 |
p = "A"
while True:
try:
s, t = input().split(",")
except EOFError as e:
break
if s == p:
p = t
elif t == p:
p = s
print(("%s" % (chA, ))) | p = "A"
while True:
try:
s, t = input().split(",")
except EOFError as e:
break
if s == p:
p = t
elif t == p:
p = s
print(("%s" % (p, ))) | [["-", 3, 4, 0, 23, 0, 657, 12, 660, 0, 22], ["+", 3, 4, 0, 23, 0, 657, 12, 660, 0, 22]] | 5 | 59 | 2 |
#include <cmath>
#include <stdio.h>
#include <string.h>
int main() {
int a;
char c[10];
int ans[4];
ans[0] = 0;
ans[1] = 0;
ans[2] = 0;
ans[3] = 0;
while (scanf("%d,%s", &a, &c) != EOF) {
if (strcmp(c, "A") == 0) {
ans[0]++;
}
if (strcmp(c, "B") == 0) {
ans[1]++;
}
if (s... | #include <cmath>
#include <stdio.h>
#include <string.h>
int main() {
int a;
char c[10];
int ans[4];
ans[0] = 0;
ans[1] = 0;
ans[2] = 0;
ans[3] = 0;
while (scanf("%d,%s", &a, &c) != EOF) {
if (strcmp(c, "A") == 0) {
ans[0]++;
}
if (strcmp(c, "B") == 0) {
ans[1]++;
}
if (s... | [["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 13]] | 1 | 195 | 4 |
//
// akjbef.cpp
//
//
// Created by Takuto on 15/6/3.
//
//
#include <cstdio>
int main() {
char in[3];
int a = 0, b = 0, ab = 0, o = 0;
while (EOF != scanf("%*d,%s", in)) {
if (in[1] == '\0')
ab++;
else if (in[0] == 'a')
a++;
else if (in[0] == 'b')
b++;
else
o++;
}... | //
// akjbef.cpp
//
//
// Created by Takuto on 15/6/3.
//
//
#include <cstdio>
int main() {
char in[3];
int a = 0, b = 0, ab = 0, o = 0;
while (EOF != scanf("%*d,%s", in)) {
if (in[1] != '\0')
ab++;
else if (in[0] == 'A')
a++;
else if (in[0] == 'B')
b++;
else
o++;
}... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["+", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125]] | 1 | 126 | 6 |
#include <algorithm>
#include <iostream>
#include <string.h>
using namespace std;
int main() {
int a, e = 0, b = 0, c = 0, d = 0;
char h;
string s;
while (cin >> a >> h >> s) {
if (s == "A")
e++;
if (s == "B")
b++;
if (s == "AB")
c++;
if (s == "O")
d++;
}
cout << a <... | #include <algorithm>
#include <iostream>
#include <string.h>
using namespace std;
int main() {
int a, e = 0, b = 0, c = 0, d = 0;
char h;
string s;
while (cin >> a >> h >> s) {
if (s == "A")
e++;
if (s == "B")
b++;
if (s == "AB")
c++;
if (s == "O")
d++;
}
cout << e <... | [["-", 31, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 31, 16, 31, 16, 31, 16, 31, 16, 12, 22]] | 1 | 115 | 2 |
#include <iostream>
#include <string.h>
#include <string>
using namespace std;
int main() {
int N, B[4];
string S;
memset(B, 0, sizeof(B));
while (cin >> N >> S) {
if (S == "A") {
B[0] += 1;
} else if (S == "B") {
B[1] += 1;
} else if (S == "AB") {
B[2] += 1;
} else if (S =... | #include <iostream>
#include <string.h>
#include <string>
using namespace std;
int main() {
int N, B[4];
string S;
memset(B, 0, sizeof(B));
while (cin >> N >> S) {
if (S == ",A") {
B[0] += 1;
} else if (S == ",B") {
B[1] += 1;
} else if (S == ",AB") {
B[2] += 1;
} else if (... | [["-", 0, 57, 15, 339, 51, 16, 12, 5, 0, 6], ["+", 0, 57, 15, 339, 51, 16, 12, 5, 0, 6]] | 1 | 153 | 8 |
#include <iostream>
#include <string>
using namespace std;
string S, T[4] = {"A", "B", "O", "AB"};
int x[4], a;
char c;
int main() {
while (cin >> a >> c >> S) {
for (int i = 0; i < 4; i++) {
if (T[i] == S) {
x[i]++;
}
}
}
cout << x[0] << endl << x[1] << endl << x[2] << endl << x[3] <<... | #include <iostream>
#include <string>
using namespace std;
string S, T[4] = {"A", "B", "AB", "O"};
int x[4], a;
char c;
int main() {
while (cin >> a >> c >> S) {
for (int i = 0; i < 4; i++) {
if (T[i] == S) {
x[i]++;
}
}
}
cout << x[0] << endl << x[1] << endl << x[2] << endl << x[3] <<... | [["-", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6], ["+", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6]] | 1 | 126 | 4 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
int a;
string str;
int cou[4] = {0};
while (scanf("%d", &a) != EOF) {
cin >> str;
if (str.size() == 3)
cou[2]++;
else if (str[0] == 'A')
cou[0]++;
else if ... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
int a;
string str;
int cou[4] = {0};
while (scanf("%d", &a) != EOF) {
cin >> str;
if (str.size() == 3)
cou[2]++;
else if (str[1] == 'A')
cou[0]++;
else if ... | [["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13]] | 1 | 152 | 6 |
//
// main.cpp
// AizuOnline
//
// Created by ?????¬ ?????? on 19/05/2016.
// Copyright ?? 2016 ?????¬ ??????. All rights reserved.
//
#include <iostream>
int main(int argc, const char *argv[]) {
int a = 0;
int b = 0;
int ab = 0;
int o = 0;
int k;
char s[5];
while (scanf("%d,%s", &k, s) != EOF) {
... | #include <iostream>
int main(int argc, const char *argv[]) {
int a = 0;
int b = 0;
int ab = 0;
int o = 0;
int k;
char s[5];
while (scanf("%d,%s", &k, s) != EOF) {
if (s[0] == 'A' && s[1] == 'B') {
ab = ab + 1;
} else if (s[0] == 'A') {
a++;
} else if (s[0] == 'B') {
b++;
... | [["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]] | 1 | 190 | 2 |
#include <iostream>
using namespace std;
int main(void) {
// Here your code !
int n, a = 0, b = 0, o = 0, ab = 0;
char c;
string d;
while (cin >> n >> c >> d) {
if (d == "B\0")
b++;
else if (d == "A\0")
a++;
else if (d == "O\0")
o++;
else if (d == "AB\0")
ab++;
}
... | #include <iostream>
using namespace std;
int main(void) {
// Here your code !
int n, a = 0, b = 0, o = 0, ab = 0;
char c;
string d;
while (cin >> n >> c >> d) {
if (d == "B\0")
b++;
else if (d == "A\0")
a++;
else if (d == "O\0")
o++;
else if (d == "AB\0")
ab++;
}
... | [["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]] | 1 | 123 | 4 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
char s[10];
int main() {
int A = 0, B = 0, AB = 0, O = 0;
int n;
while (scanf("%d,%s", &n, s) != EOF) {
if (!strcmp(s, "A"))
A++;
if (!strcmp(s, "B"))
B++;
if (!strcmp(s, "AB"))
AB++;
els... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
char s[10];
int main() {
int A = 0, B = 0, AB = 0, O = 0;
int n;
while (scanf("%d,%s", &n, s) != EOF) {
if (!strcmp(s, "A"))
A++;
else if (!strcmp(s, "B"))
B++;
else if (!strcmp(s, "AB"))
AB+... | [["+", 0, 52, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]] | 1 | 134 | 2 |
#include <iostream>
#include <string>
using namespace std;
int main() {
int a;
char b;
string c;
int d[4] = {0};
while (cin >> a >> b) {
cin >> c;
if (c == "A") {
d[0] += 1;
} else if (c == "B") {
d[1] += 1;
} else if (c == "O") {
d[2] += 1;
} else if (c == "AB") {
... | #include <iostream>
#include <string>
using namespace std;
int main() {
int a;
char b;
string c;
int d[4] = {0};
while (cin >> a >> b) {
cin >> c;
if (c == "A") {
d[0] += 1;
} else if (c == "B") {
d[1] += 1;
} else if (c == "AB") {
d[2] += 1;
} else if (c == "O") {
... | [["-", 0, 57, 15, 339, 51, 16, 12, 5, 0, 6], ["+", 0, 57, 15, 339, 51, 16, 12, 5, 0, 6]] | 1 | 148 | 4 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a[4] = {0}, p = 0, u = 2, q = 0;
string s;
while (cin >> s) {
p++;
if (!q && p >= 10)
u++;
if (s.size() > u + 1)
a[2]++;
else if (s[u] == 'B')
a[1]++;
else if (s[u] == 'O')
a[3]++;
else
a[0]++;
}... | #include <bits/stdc++.h>
using namespace std;
int main() {
int a[4] = {0}, p = 0, u = 2, q = 0;
string s;
while (cin >> s) {
p++;
if (!q && p >= 10) {
u++;
q++;
}
if (s.size() > u + 1)
a[2]++;
else if (s[u] == 'B')
a[1]++;
else if (s[u] == 'O')
a[3]++;
els... | [["+", 0, 52, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 17, 29], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46]] | 1 | 144 | 5 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define INF 1000000000
#define mod 1000000007
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define INF 1000000000
#define mod 1000000007
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep... | [["-", 0, 57, 15, 339, 51, 16, 12, 5, 0, 6], ["+", 0, 57, 15, 339, 51, 16, 12, 5, 0, 6]] | 1 | 217 | 4 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n, a = 0, b = 0, o = 0, ab = 0;
char g;
string x;
while (cin >> n >> g >> x) {
if (x == "A") {
a++;
} else if (x == "B") {
b++;
} else if (x == "O") {
... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n, a = 0, b = 0, o = 0, ab = 0;
char g;
string x;
while (cin >> n >> g >> x) {
if (x == "A") {
a++;
} else if (x == "B") {
b++;
} else if (x == "O") {
... | [["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]] | 1 | 133 | 4 |
#include <stdio.h>
int main() {
int n, ans[4] = {0, 0, 0, 0};
char a[10] = {'\0'};
while (scanf("%d,%s", &n, a) != EOF) {
if (a[0] == 'B')
ans[1]++;
if (a[0] == 'O')
ans[3]++;
if (a[0] == 'A') {
if (a[1] == 'B')
ans[2]++;
else
ans[0]++;
ans[1] = '\0';
... | #include <stdio.h>
int main() {
int n, ans[4] = {0, 0, 0, 0};
char a[10] = {'\0'};
while (scanf("%d,%s", &n, a) != EOF) {
if (a[0] == 'B')
ans[1]++;
if (a[0] == 'O')
ans[3]++;
if (a[0] == 'A') {
if (a[1] == 'B')
ans[2]++;
else
ans[0]++;
a[1] = '\0';
}
... | [["-", 64, 9, 0, 1, 0, 11, 31, 69, 28, 22], ["+", 64, 9, 0, 1, 0, 11, 31, 69, 28, 22], ["-", 8, 1, 0, 2, 3, 4, 0, 69, 28, 22], ["+", 8, 1, 0, 2, 3, 4, 0, 69, 28, 22]] | 1 | 163 | 4 |
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
int n, A[4];
fill(A, A + 4, 0);
char b[10];
while (scanf("%d,%s ", &n, b) == 2) {
if (b[0] == 'A') {
if (b[1] == 'B') {
A[3]++;
} else {
A[0]++;
}
} else if (b[0] == 'B') {
A[1]++;
} els... | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
int n, A[4];
fill(A, A + 4, 0);
char b[10];
while (scanf("%d,%s ", &n, b) == 2) {
if (b[0] == 'A') {
if (b[1] == 'B') {
A[2]++;
} else {
A[0]++;
}
} else if (b[0] == 'B') {
A[1]++;
} els... | [["-", 0, 1, 0, 27, 28, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 27, 28, 69, 341, 342, 0, 13]] | 1 | 170 | 4 |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
string s;
vector<int> count(4);
count[0] = 0;
count[1] = 0;
count[2] = 0;
count[3] = 0;
while (cin >> s) {
string::size_type comma = s.find(",");
string bloodtype = s.substr(comma + 1);
if (bloodtype ==... | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
string s;
vector<int> count(4);
count[0] = 0;
count[1] = 0;
count[2] = 0;
count[3] = 0;
while (cin >> s) {
string::size_type comma = s.find(",");
string bloodtype = s.substr(comma + 1);
if (bloodtype ==... | [["-", 0, 57, 15, 339, 51, 16, 12, 5, 0, 6], ["+", 0, 57, 15, 339, 51, 16, 12, 5, 0, 6]] | 1 | 182 | 4 |
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
using namespace std;
int main() {
int num;
string blood;
char row[1000];
map<string, int> type;
type.insert(make_pair("A", 0));
type.insert(make_pair("B", 0));
type.insert(make_pair("O", 0));
type.insert(make_pair("AB", 0));
whil... | #include <cstdio>
#include <iostream>
#include <map>
#include <string>
using namespace std;
int main() {
int num;
char blood[100];
char row[1000];
map<string, int> type;
type.insert(make_pair("A", 0));
type.insert(make_pair("B", 0));
type.insert(make_pair("O", 0));
type.insert(make_pair("AB", 0));
w... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 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]] | 1 | 180 | 5 |
#include <iostream>
#include <string>
using namespace std;
int main() {
int h, at = 0, bt = 0, ot = 0, abt = 0;
char c;
string b;
while (cin >> h >> c >> b) {
if (b == "A")
at++;
if (b == "B")
bt++;
if (b == "O")
ot++;
if (b == "AB")
abt++;
}
cout << at << endl << bt ... | #include <iostream>
#include <string>
using namespace std;
int main() {
int h, at = 0, bt = 0, ot = 0, abt = 0;
char c;
string b;
while (cin >> h >> c >> b) {
if (b == "A")
at++;
if (b == "B")
bt++;
if (b == "O")
ot++;
if (b == "AB")
abt++;
}
cout << at << endl << bt ... | [["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]] | 1 | 116 | 4 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
#define pu push
#define pb push_back
... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
#define pu push
#define pb push_back
... | [["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]] | 1 | 198 | 4 |
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
char blood[2];
int n, type_num[4];
string type[4] = {"A", "B", "C", "AB"};
for (int i = 0; i < 4; i++)
type_num[i] = 0;
while (~scanf("%d,%s ", &n, blood)) {
for (int i = 0; i < 4; i++) {
if (blood == type[i])
typ... | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
char blood[2];
int n, type_num[4];
string type[5] = {"A", "B", "AB", "O"};
for (int i = 0; i < 4; i++)
type_num[i] = 0;
while (~scanf("%d,%s ", &n, blood)) {
for (int i = 0; i < 4; i++) {
if (blood == type[i])
typ... | [["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["-", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6], ["+", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6]] | 1 | 149 | 6 |
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
int no;
char delim;
string blood;
int A = 0, B = 0, AB = 0, O = 0;
while (cin >> no >> delim >> blood) {
if (blood == "A")
A++;
else if (blood == "B")
A++;
else if (blood == "AB")
AB++;
else if (blood == ... | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
int no;
char delim;
string blood;
int A = 0, B = 0, AB = 0, O = 0;
while (cin >> no >> delim >> blood) {
if (blood == "A")
A++;
else if (blood == "B")
B++;
else if (blood == "AB")
AB++;
else if (blood == ... | [["-", 75, 76, 0, 57, 64, 1, 0, 27, 28, 22], ["+", 75, 76, 0, 57, 64, 1, 0, 27, 28, 22]] | 1 | 120 | 2 |
// include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include... | // include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include... | [["-", 3, 4, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 3, 4, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 31, 16, 12, 69, 341, 342, 0, 5, 0, 6], ["+", 31, 16, 12, 69, 341, 342, 0, 5, 0, 6]] | 1 | 443 | 8 |
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
a = 0; b = 0; o = 0; ab =... | #!/usr/bin/ruby
# -*- coding: utf-8 -*-
a = 0; b = 0; o = 0; ab =... | [["-", 36, 36, 0, 493, 0, 652, 3, 4, 0, 22], ["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 0, 493, 0, 652, 3, 4, 0, 22]] | 4 | 80 | 4 |
r = {"A" => 0, "B" => 0, "AB" => 0, "O" => 0}
while a = gets.chomp
r[a.split(",")[1]] += 1
end
r.each_value{ |i|
puts i
} | r = {"A" => 0, "B" => 0, "AB" => 0, "O" => 0}
begin
while a = gets.chomp
r[a.split(",")[1]] += 1
end
rescue
end
r.each_value{ |i|
puts i
} | [["+", 36, 36, 36, 36, 0, 493, 0, 756, 0, 756], ["+", 0, 493, 0, 756, 0, 89, 8, 170, 0, 444], ["+", 36, 36, 0, 493, 0, 756, 0, 764, 0, 764]] | 4 | 60 | 4 |
r = {"A" => 0, "B" => 0, "AB" => 0, "O" => 0}
while a = gets.chomp
r[a.split(",")[1]] += 1
end
r.each_value{ |i|
puts i
} | r = {"A" => 0, "B" => 0, "AB" => 0, "O" => 0}
while a = gets
r[a.chomp.split(",")[1]] += 1
end
r.each_value{ |i|
puts i
} | [["-", 0, 493, 0, 89, 15, 662, 12, 652, 17, 131], ["-", 0, 493, 0, 89, 15, 662, 12, 652, 735, 22], ["+", 31, 742, 0, 742, 500, 652, 486, 652, 17, 131], ["+", 31, 742, 0, 742, 500, 652, 486, 652, 735, 22]] | 4 | 60 | 4 |
blood_count = {"A"=>0, "B"=>0, "AB"=>0, "O"=>0}
while input_data = gets
blood_type = input_data.chomp.split(',')
p blood_type
blood_count[blood_type[1]] += 1
end
blood_types = ["A", "B", "AB", "O"]
blood_types.each { |blood|
puts blood_count[blood]
} | blood_count = {"A"=>0, "B"=>0, "AB"=>0, "O"=>0}
while input_data = gets
blood_type = input_data.chomp.split(',')
blood_count[blood_type[1]] += 1
end
blood_types = ["A", "B", "AB", "O"]
blood_types.each { |blood|
puts blood_count[blood]
} | [["-", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22], ["-", 0, 89, 8, 170, 0, 652, 3, 4, 0, 22]] | 4 | 87 | 2 |
from sys import *
lis = {"A":0,"B":0,"O":0,"AB":0}
for s in stdin:
n,t = list(map(str,s[:-1].split(",")))
lis[t] += 1
print(lis["A"])
print(lis["B"])
print(lis["O"])
print(lis["AB"]) | from sys import *
lis = {"A":0,"B":0,"O":0,"AB":0}
for s in stdin:
n,t = list(map(str,s[:-1].split(",")))
lis[t] += 1
print(lis["A"])
print(lis["B"])
print(lis["AB"])
print(lis["O"]) | [["-", 0, 652, 3, 4, 0, 206, 206, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 206, 206, 557, 0, 6]] | 5 | 103 | 4 |
l=[0]*4
while True:
try:
a,b=list(map(int,input().split(",")))
if b=="A":
l[0]+=1
elif b=="B":
l[1]+=1
elif b=="AB":
l[2]+=1
else:
l[3]+=1
except:
break
for i in l:
print(i) | l=[0]*4
while True:
try:
a,b=list(map(str,input().split(",")))
if b=="A":
l[0]+=1
elif b=="B":
l[1]+=1
elif b=="AB":
l[2]+=1
else:
l[3]+=1
except:
break
for i in l:
print(i) | [["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22]] | 5 | 93 | 2 |
ac = bc = oc = abc = 0
while 1:
try: n, bt = input().split(",")
except: break
if bt == "A": ac += 1
elif bt == "B": bc += 1
elif bt == "O": oc += 1
elif bt == "AB": abc +=1
print(ac)
print(bc)
print(oc)
print(abc)
| ac = bc = oc = abc = 0
while 1:
try: n, bt = input().split(",")
except: break
if bt == "A": ac += 1
elif bt == "B": bc += 1
elif bt == "O": oc += 1
elif bt == "AB": abc +=1
print(ac)
print(bc)
print(abc)
print(oc)
| [["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 87 | 4 |
blood = []
while True:
try:
x = list(map(int,input().split(',')))
blood.append(x[1])
except: break
print(blood.count('A'))
print(blood.count('B'))
print(blood.count('AB'))
print(blood.count('O')) | blood = []
while True:
try:
x = list(map(str,input().split(',')))
blood.append(x[1])
continue
except: break
print(blood.count('A'))
print(blood.count('B'))
print(blood.count('AB'))
print(blood.count('O')) | [["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 246, 8, 196, 0, 116, 0, 117]] | 5 | 85 | 3 |
#include <iostream>
#include <string.h>
#include <string>
using namespace std;
int main(void) {
double weight[] = {48, 51, 54, 57, 60, 64, 69, 75, 81, 91};
double n;
string name[11] = {"lght fly", "fly", "bantam", "feather",
"light", "light welter", "welter", "light middle",
... | #include <iostream>
#include <string.h>
#include <string>
using namespace std;
int main(void) {
double weight[] = {48, 51, 54, 57, 60, 64, 69, 75, 81, 91};
double n;
string name[11] = {"light fly", "fly", "bantam", "feather",
"light", "light welter", "welter", "light middle",
... | [["-", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6], ["+", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6]] | 1 | 213 | 2 |
#include <iostream>
using namespace std;
int main() {
double n;
while (cin >> n) {
if (n > 91)
cout << "heavy" << endl;
else if (n > 81)
cout << "light heavy" << endl;
else if (n > 75)
cout << "middle" << endl;
else if (n > 69)
cout << "light middle" << endl;
else if ... | #include <iostream>
using namespace std;
int main() {
double n;
while (cin >> n) {
if (n > 91)
cout << "heavy" << endl;
else if (n > 81)
cout << "light heavy" << endl;
else if (n > 75)
cout << "middle" << endl;
else if (n > 69)
cout << "light middle" << endl;
else if ... | [["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 181 | 2 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
double r;
while (cin >> r) {
if (r <= 48.00) {
cout << "light fly" << endl;
} else if (r <= 51.00) {
cout << "fly" << endl;
} else if (r <= 54.00) {
cout << "bantam" << endl;
} else if (r <= 57.00) {
... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
double r;
while (cin >> r) {
if (r <= 48.00) {
cout << "light fly" << endl;
} else if (r <= 51.00) {
cout << "fly" << endl;
} else if (r <= 54.00) {
cout << "bantam" << endl;
} else if (r <= 57.00) {
... | [["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 205 | 4 |
#include <iostream>
using namespace std;
int main() {
double h;
while (cin >> h) {
if (h <= 48.000)
cout << "light fly" << endl;
else if (h <= 51.000)
cout << "fly" << endl;
else if (h <= 54.000)
cout << "bantam" << endl;
else if (h <= 57.000)
cout << "feather" << endl;
e... | #include <iostream>
using namespace std;
int main() {
double h;
while (cin >> h) {
if (h <= 48.000)
cout << "light fly" << endl;
else if (h <= 51.000)
cout << "fly" << endl;
else if (h <= 54.000)
cout << "bantam" << endl;
else if (h <= 57.000)
cout << "feather" << endl;
e... | [["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 190 | 4 |
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
string s[11] = {"light fly", "fly", "bantam", "feather",
"light", "light welther", "welter", "light middle",
"middle", "light heavy", "heavy"};
double b[11] = {48, 51, 54, 57, 60, 64, 69, ... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
string s[11] = {"light fly", "fly", "bantam", "feather",
"light", "light welter", "welter", "light middle",
"middle", "light heavy", "heavy"};
double b[11] = {48, 51, 54, 57, 60, 64, 69, 75,... | [["-", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6], ["+", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6]] | 1 | 130 | 2 |
#include <iostream>
using namespace std;
const char *str[] = {"light fly", "fly", "bantam", "feather",
"light", "light welter", "welter", "light middle",
"middle", "light heavy", "heavy"};
const double n[] = {48, 51, 54, 57, 60, 64, 69, 75, 81, 91};
#define R... | #include <iostream>
using namespace std;
const char *str[] = {"light fly", "fly", "bantam", "feather",
"light", "light welter", "welter", "light middle",
"middle", "light heavy", "heavy"};
const double n[] = {48, 51, 54, 57, 60, 64, 69, 75, 81, 91, 1e9};
#def... | [["+", 0, 30, 0, 43, 49, 50, 51, 83, 0, 21], ["+", 0, 30, 0, 43, 49, 50, 51, 83, 0, 13]] | 1 | 164 | 2 |
#include <iostream>
#include <math.h>
using namespace std;
int main() {
double glam;
while (cin >> glam) {
if (glam < 48.0)
cout << "light fly" << endl;
else if (glam > 48.0 && glam <= 51.0)
cout << "fly" << endl;
else if (glam > 51.0 && glam <= 54.0)
cout << "bantam" << endl;
els... | #include <iostream>
#include <math.h>
using namespace std;
int main() {
double glam;
while (cin >> glam) {
if (glam <= 48.0)
cout << "light fly" << endl;
else if (glam > 48.0 && glam <= 51.0)
cout << "fly" << endl;
else if (glam > 51.0 && glam <= 54.0)
cout << "bantam" << endl;
el... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 219 | 2 |
#include <stdio.h>
void func(float);
int main(void) {
float tai;
while (scanf("%f", &tai) != EOF) {
func(tai);
}
return 0;
}
void func(float tai) {
float lim[10] = {48.0, 51.0, 54.0, 57.0, 60.0, 64.0, 69.0, 75.0, 81.0, 91.0};
char kai[11][13] = {"light fly", "fly", "bantam", "frather",
... | #include <stdio.h>
void func(float);
int main(void) {
float tai;
while (scanf("%f", &tai) != EOF) {
func(tai);
}
return 0;
}
void func(float tai) {
float lim[10] = {48.0, 51.0, 54.0, 57.0, 60.0, 64.0, 69.0, 75.0, 81.0, 91.0};
char kai[11][13] = {"light fly", "fly", "bantam", "feather",
... | [["-", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6], ["+", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6]] | 1 | 177 | 4 |
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
int main() {
double n;
while (scanf("%lf", &n) != EOF) {
if (n <= 48.00)
printf("light fly\n");
else if (48.00 < n && n <= 51.00)
printf("fly\n");
else if (51.00 < n && n <= 54.00)
printf("bantam\n");
els... | #include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
int main() {
double n;
while (scanf("%lf", &n) != EOF) {
if (n <= 48.00)
printf("light fly\n");
else if (48.00 < n && n <= 51.00)
printf("fly\n");
else if (51.00 < n && n <= 54.00)
printf("bantam\n");
els... | [["-", 75, 76, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 236 | 4 |
#include <iostream>
#include <string>
using namespace std;
const string cls[] = {"",
"light fly",
"fly",
"bantam",
"feather",
"light",
"light welter",
"welter",
... | #include <iostream>
#include <string>
using namespace std;
const string cls[] = {"",
"light fly",
"fly",
"bantam",
"feather",
"light",
"light welter",
"welter",
... | [["+", 0, 30, 0, 43, 49, 50, 51, 83, 0, 21], ["+", 0, 30, 0, 43, 49, 50, 51, 83, 0, 13]] | 1 | 136 | 2 |
#include <iostream>
using namespace std;
int main() {
char clsnam[11][20] = {"light fly", "fly", "bantam", "feather",
"light", "light welter", "welter", "light middle",
"middle", "light heavy", "heavy"};
double CLASS[10] = {48.00, 51.00, 54.00, 57... | #include <iostream>
using namespace std;
int main() {
char clsnam[11][20] = {"light fly", "fly", "bantam", "feather",
"light", "light welter", "welter", "light middle",
"middle", "light heavy", "heavy"};
double CLASS[10] = {48.00, 51.00, 54.00, 57... | [["+", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22]] | 1 | 167 | 2 |
classes = %w(light_fly fly bantam feather light light_welter welter light_middle mddle light_heavy heavy)
upper_bound = [48,51,54,57,60,64,69,75,81,91, Float::INFINITY]
puts $<.map {|s|
classes[upper_bound.index{|ub| s.to_f <= ub}].sub(?_, ' ')
} | classes = %w(light_fly fly bantam feather light light_welter welter light_middle middle light_heavy heavy)
upper_bound = [48,51,54,57,60,64,69,75,81,91, Float::INFINITY]
puts $<.map {|s|
classes[upper_bound.index{|ub| s.to_f <= ub}].sub(?_, ' ')
} | [["-", 0, 493, 0, 662, 12, 765, 0, 766, 0, 6], ["+", 0, 493, 0, 662, 12, 765, 0, 766, 0, 6]] | 4 | 76 | 2 |
def result(w)
r = ""
if w <= 48.0 then r = "light fly"
elsif w <= 51.0 then r = "fly"
elsif w <= 54.0 then r = "bandam"
elsif w <= 57.0 then r = "feather"
elsif w <= 60.0 then r = "light"
elsif w <= 64.0 then r = "light welter"
elsif w <= 69.0 then r = "welter"
elsif w <= 75.0 then r = "light middle"
... | def result(w)
r = ""
if w <= 48.0 then r = "light fly"
elsif w <= 51.0 then r = "fly"
elsif w <= 54.0 then r = "bantam"
elsif w <= 57.0 then r = "feather"
elsif w <= 60.0 then r = "light"
elsif w <= 64.0 then r = "light welter"
elsif w <= 69.0 then r = "welter"
elsif w <= 75.0 then r = "light middle"
... | [["-", 75, 759, 64, 749, 0, 662, 12, 557, 0, 6], ["+", 75, 759, 64, 749, 0, 662, 12, 557, 0, 6]] | 4 | 136 | 2 |
C = {
48 => 'light fly',
51 => 'fly',
54 => 'bandam',
57 => 'feather',
60 => 'light',
64 => 'light welter',
69 => 'welter',
75 => 'light middle',
81 => 'middle',
91 => 'light heavy',
9999 => 'heavy'
}
while s = gets
w = s.to_f
n = nil
C.sort.each { |k, v|
if w <= k
n = v
... | C = {
48 => 'light fly',
51 => 'fly',
54 => 'bantam',
57 => 'feather',
60 => 'light',
64 => 'light welter',
69 => 'welter',
75 => 'light middle',
81 => 'middle',
91 => 'light heavy',
9999 => 'heavy'
}
while s = gets
w = s.to_f
n = nil
C.sort.each { |k, v|
if w <= k
n = v
... | [["-", 0, 662, 12, 767, 0, 569, 51, 557, 0, 6], ["+", 0, 662, 12, 767, 0, 569, 51, 557, 0, 6]] | 4 | 115 | 2 |
while input = gets;
break if input == nil
weight = input.to_f
if weight <= 48.0 then
print "lighy fly\n"
elsif weight > 48.0 && weight <= 51.0 then
print "fly\n"
elsif weight > 51.0 && weight <= 54.0 then
print "bantam\n"
elsif weight > 54.0 && weight <= 57.0 then
print "feather\n"
elsif weight > 57.0... |
while input = gets;
break if input == nil
weight = input.to_f
if weight <= 48.0 then
print "light fly\n"
elsif weight > 48.0 && weight <= 51.0 then
print "fly\n"
elsif weight > 51.0 && weight <= 54.0 then
print "bantam\n"
elsif weight > 54.0 && weight <= 57.0 then
print "feather\n"
elsif weight > 57.0... | [["-", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6]] | 4 | 159 | 2 |
import sys
f = sys.stdin
classes = {'light fly':(00.00, 48.00),
'fly':(48.00, 51.00),
'bantam':(51.00, 54.00),
'feather':(54.00,57.00),
'light':(57.00,60.00),
'light welter':(60.00,64.00),
'welter':(64.00,69.00),
'light middle':(69.00,75.00... | import sys
f = sys.stdin
classes = {'light fly':(00.00, 48.00),
'fly':(48.00, 51.00),
'bantam':(51.00, 54.00),
'feather':(54.00,57.00),
'light':(57.00,60.00),
'light welter':(60.00,64.00),
'welter':(64.00,69.00),
'light middle':(69.00,75.00)... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]] | 5 | 160 | 4 |
# -*- coding: utf-8 -*-
import sys
for line in sys.stdin:
w = float(line)
if w <= 48.00:
print("light fly")
elif w <= 51.00:
print("fly")
elif w <= 54.00:
print("bantam")
elif w <= 57.00:
print("feather")
elif w <= 60.00:
print("light")
elif w <= 64.... | # -*- coding: utf-8 -*-
import sys
for line in sys.stdin:
w = float(line)
if w <= 48.00:
print("light fly")
elif w <= 51.00:
print("fly")
elif w <= 54.00:
print("bantam")
elif w <= 57.00:
print("feather")
elif w <= 60.00:
print("light")
elif w <= 64.... | [["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]] | 5 | 134 | 2 |
import sys
for e in sys.stdin:
e=float(e)
h=['light ','']
a=h[e>91]+'heavy'if e>81 else h[e>75]+'middle'if e>69 else h[e>64]+'welter'if e>60 else'light'if e>57 else'feather'if e>51 else'bantam'if e>51 else h[e>48]+'fly'
print(a)
| import sys
for e in sys.stdin:
e=float(e)
h=['light ','']
a=h[e>91]+'heavy'if e>81 else h[e>75]+'middle'if e>69 else h[e>64]+'welter'if e>60 else'light'if e>57 else'feather'if e>54 else'bantam'if e>51 else h[e>48]+'fly'
print(a)
| [["-", 0, 41, 0, 41, 0, 41, 0, 666, 0, 612], ["+", 0, 41, 0, 41, 0, 41, 0, 666, 0, 612]] | 5 | 110 | 2 |
import bisect
w = [48, 51, 54, 57, 60, 64, 69, 75, 81, 91]
c = ["light fly", "fly", "bantam", "feather", "feather", "light welter", "welter", "light middle", "middle", "light heavy", "heavy"]
while 1:
try:print(c[bisect.bisect_left(w,float(input()))])
except:break
| import bisect
w = [48, 51, 54, 57, 60, 64, 69, 75, 81, 91]
c = ["light fly", "fly", "bantam", "feather", "light", "light welter", "welter", "light middle", "middle", "light heavy", "heavy"]
while 1:
try:print(c[bisect.bisect_left(w,float(input()))])
except:break
| [["-", 0, 1, 0, 662, 12, 634, 0, 557, 0, 6], ["+", 0, 1, 0, 662, 12, 634, 0, 557, 0, 6]] | 5 | 99 | 2 |
import sys
WEIGHT=[91.0, 81.0, 75.0, 69.0, 64.0, 60.0, 57.0, 54.0, 51.0, 48.0,-1]
GRADE=['heavy', 'light heavy', 'middle', 'light', 'welter', 'light welter', 'light', 'feather', 'bantam', 'fly', 'light fly']
for line in sys.stdin.readlines():
weight=float(line.strip())
for i in range(len(GRADE)):
if wei... | import sys
WEIGHT=[91.0, 81.0, 75.0, 69.0, 64.0, 60.0, 57.0, 54.0, 51.0, 48.0,-1]
GRADE=['heavy', 'light heavy', 'middle', 'light middle', 'welter', 'light welter', 'light', 'feather', 'bantam', 'fly', 'light fly']
for line in sys.stdin.readlines():
weight=float(line.strip())
for i in range(len(GRADE)):
... | [["-", 0, 1, 0, 662, 12, 634, 0, 557, 0, 6], ["+", 0, 1, 0, 662, 12, 634, 0, 557, 0, 6]] | 5 | 123 | 2 |
def jug(a):
if a <= 48.0:
print("light fly")
elif a <= 51.0:
print("fly")
elif a <= 45.0:
print("bantam")
elif a <= 57.0:
print("feather")
elif a <= 60.0:
print("light")
elif a <= 64.0:
print("light welter")
elif a <= 69.0:
print('welte... | def jug(a):
if a <= 48.0:
print("light fly")
elif a <= 51.0:
print("fly")
elif a <= 54.0:
print("bantam")
elif a <= 57.0:
print("feather")
elif a <= 60.0:
print("light")
elif a <= 64.0:
print("light welter")
elif a <= 69.0:
print('welte... | [["-", 8, 196, 0, 57, 75, 665, 15, 666, 0, 531], ["+", 8, 196, 0, 57, 75, 665, 15, 666, 0, 531]] | 5 | 145 | 2 |
import sys
c=["light fly", "fly", "bantam", "feather", "light", "light welter",
"welter", "light middle", "middle", "light heavy", "heavy"]
w=[48,51,54,57,60,64,69,75,81,91]
for s in map(float,sys.stdin):
i=0
while w[i]<s:
i+=1
print(c[i]) | import sys
c=["light fly", "fly", "bantam", "feather", "light", "light welter",
"welter", "light middle", "middle", "light heavy", "heavy"]
w=[48,51,54,57,60,64,69,75,81,91]
for s in map(float,sys.stdin):
i=0
for e in w:
if e<s: i+=1
print(c[i]) | [["-", 0, 656, 0, 7, 8, 196, 0, 52, 0, 89], ["+", 0, 656, 0, 7, 8, 196, 0, 7, 0, 88], ["+", 0, 656, 0, 7, 8, 196, 0, 7, 31, 22], ["+", 0, 656, 0, 7, 8, 196, 0, 7, 0, 267], ["-", 8, 196, 0, 52, 15, 666, 0, 206, 0, 70], ["-", 8, 196, 0, 52, 15, 666, 0, 206, 206, 22], ["-", 8, 196, 0, 52, 15, 666, 0, 206, 0, 73], ["+", 0,... | 5 | 105 | 7 |
import java.io.*;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = "";
int a = 0;
int b = 0;
int ab = 0;
int o = 0;
while ((line = br.readLine()) != null) {
String str = l... | import java.io.*;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = "";
int a = 0;
int b = 0;
int ab = 0;
int o = 0;
while ((line = br.readLine()) != null) {
String str = l... | [["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 44]] | 3 | 190 | 3 |
import java.util.Scanner;
class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
String str;
int[] blood = new int[4];
while (scan.hasNext()) {
str = scan.next();
String[] num = str.split(",", 0);
if (num[1].equals("A"))
blood[0]++;
... | import java.util.Scanner;
class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
String str;
int[] blood = new int[4];
while (scan.hasNext()) {
str = scan.next();
String[] num = str.split(",", 0);
if (num[1].equals("A"))
blood[0]++;
... | [["-", 0, 57, 64, 1, 0, 27, 0, 504, 71, 499], ["+", 0, 57, 64, 1, 0, 27, 0, 504, 71, 499]] | 3 | 190 | 4 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String bloodType;
int type[] = new int[4];
while ((bl... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String bloodType;
int type[] = new int[4];
while ((bl... | [["-", 49, 200, 51, 492, 3, 4, 0, 5, 0, 491], ["+", 49, 200, 51, 492, 3, 4, 0, 5, 0, 491]] | 3 | 218 | 2 |
import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.io.*;
import java.lang.*;
import java.math.*;
import java.util.*;
public class Main {
Scanner sc;
static final int INF = 1 << 28;
static final double EPS = 1e-9;
void run() {
sc = new Scanner(System.in);
int a = 0, b = 0,... | import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.io.*;
import java.lang.*;
import java.math.*;
import java.util.*;
public class Main {
Scanner sc;
static final int INF = 1 << 28;
static final double EPS = 1e-9;
void run() {
sc = new Scanner(System.in);
int a = 0, b = 0,... | [["-", 8, 196, 0, 7, 8, 196, 0, 93, 0, 94], ["-", 8, 196, 0, 7, 8, 196, 0, 93, 0, 35]] | 3 | 279 | 2 |
import java.util.*;
class Main {
public static void main(String a[]) throws java.io.IOException {
Scanner scan = new Scanner(System.in);
int[] bType = {0, 0, 0, 0};
scan.useDelimiter("\\d*,|\\n\\d*,");
while (scan.hasNext()) {
String blood = scan.next();
if (blood.compareTo("A") == 0)
... | import java.util.*;
class Main {
public static void main(String a[]) throws java.io.IOException {
Scanner scan = new Scanner(System.in);
int[] bType = {0, 0, 0, 0};
scan.useDelimiter("\\d*,|\\n\\d*,|\\n");
while (scan.hasNext()) {
String blood = scan.next();
if (blood.compareTo("A") == 0... | [["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 44]] | 3 | 180 | 4 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int a = 0, b = 0, o = 0, ab = 0;
while (in.hasNextLine()) {
String str = in.next();
if (str.contains("AB")) {
ab++;
} else if (str.contains("A")) {
... |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int a = 0, b = 0, o = 0, ab = 0;
while (in.hasNextLine()) {
String str = in.nextLine();
if (str.contains("AB")) {
ab++;
} else if (str.contains("A")) {
... | [["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22]] | 3 | 163 | 2 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = "";
int a = 0, b = 0, o = 0, ab = 0;
... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = "";
int a = 0, b = 0, o = 0, ab = 0;
... | [["-", 15, 15, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 15, 15, 0, 492, 3, 4, 0, 5, 0, 491], ["-", 8, 196, 0, 57, 64, 1, 0, 27, 0, 22], ["+", 8, 196, 0, 57, 64, 1, 0, 27, 0, 22], ["-", 3, 4, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 3, 4, 0, 16, 31, 16, 31, 16, 12, 22], ["-", 0, 1, 0, 492, 3, 4, 0, 16, 12, 22], ["+", 0, 1, 0, 49... | 3 | 199 | 12 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int[] c = new int[4];
while (sc.hasNext()) {
String b = sc.next().split(",")[1];
if (b.equals("A"))
c[1]++;
else if (b.equals("B"))
c[2]++;
... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int[] c = new int[4];
while (sc.hasNext()) {
String b = sc.next().split(",")[1];
if (b.equals("A"))
c[0]++;
else if (b.equals("B"))
c[1]++;
... | [["-", 0, 57, 64, 1, 0, 27, 0, 504, 71, 499], ["+", 0, 57, 64, 1, 0, 27, 0, 504, 71, 499], ["-", 75, 57, 64, 1, 0, 27, 0, 504, 71, 499], ["+", 75, 57, 64, 1, 0, 27, 0, 504, 71, 499], ["-", 75, 57, 75, 1, 0, 27, 0, 504, 71, 499], ["+", 75, 57, 75, 1, 0, 27, 0, 504, 71, 499]] | 3 | 161 | 8 |
#include <stdio.h>
int main(void) {
int number;
char str[2];
int a = 0;
int b = 0;
int ab = 0;
int o = 0;
while (scanf("%d", &number) != EOF) {
scanf("%s", str);
if (str[0] == 'A') {
if (str[1] == 'B') {
ab++;
} else {
a++;
}
}
if (str[0] == 'B') {
b... | #include <stdio.h>
int main(void) {
int number;
char str[2];
int a = 0;
int b = 0;
int ab = 0;
int o = 0;
while (scanf("%d,", &number) != EOF) {
scanf("%s", str);
if (str[0] == 'A') {
if (str[1] == 'B') {
ab++;
} else {
a++;
}
}
if (str[0] == 'B') {
... | [["-", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6]] | 0 | 155 | 2 |
#include <stdio.h>
int main(void) {
int i, n;
char t[4];
int c[4];
for (i = 0; i < 4; ++i)
c[i] = 0;
while (scanf("%d,%s", &n, t) != EOF) {
switch (t[0]) {
case 'A':
if (t[1] == 'B')
c[2]++;
else
c[0]++;
break;
case 'B':
c[1]++;
break;
case 'O... |
#include <stdio.h>
int main(void) {
int i, n;
char t[4];
int c[4];
for (i = 0; i < 4; ++i)
c[i] = 0;
while (scanf("%d,%s", &n, t) != EOF) {
switch (t[0]) {
case 'A':
if (t[1] == 'B')
c[2]++;
else
c[0]++;
break;
case 'B':
c[1]++;
break;
case 'O... | [["-", 0, 57, 15, 23, 0, 16, 31, 69, 71, 13], ["+", 0, 57, 15, 23, 0, 16, 31, 69, 71, 13], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 13]] | 0 | 171 | 6 |
#include <stdio.h>
#include <string.h>
int a, b, o, ab, n;
char x[5];
int main() {
a = b = o = ab = 0;
while (scanf("%d,%s", &n, x) != EOF) {
if (strcmp(x, "A") == 0)
a++;
if (strcmp(x, "B") == 0)
b++;
if (strcmp(x, "O") == 0)
o++;
if (strcmp(x, "AB") == 0)
ab++;
}
prin... | #include <stdio.h>
#include <string.h>
int a, b, o, ab, n;
char x[5];
int main() {
a = b = o = ab = 0;
while (scanf("%d,%s", &n, x) != EOF) {
if (strcmp(x, "A") == 0)
a++;
if (strcmp(x, "B") == 0)
b++;
if (strcmp(x, "O") == 0)
o++;
if (strcmp(x, "AB") == 0)
ab++;
}
prin... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 0 | 144 | 4 |
#include <stdio.h>
#include <string.h>
int main(void) {
int n, a = 0, b = 0, ab = 0, o = 0;
char t[3];
while (scanf("%d %s", &n, &t) != EOF) {
if (strcmp(t, "A") == 0) {
a++;
} else if (strcmp(t, "B") == 0) {
b++;
} else if (strcmp(t, "AB") == 0) {
ab++;
} else if (strcmp(t, "O"... | #include <stdio.h>
#include <string.h>
int main(void) {
int n, a = 0, b = 0, ab = 0, o = 0;
char t[3];
while (scanf("%d,%s", &n, t) != EOF) {
if (strcmp(t, "A") == 0) {
a++;
}
if (strcmp(t, "B") == 0) {
b++;
}
if (strcmp(t, "AB") == 0) {
ab++;
}
if (strcmp(t, "O") ==... | [["-", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 16, 31, 2, 3, 4, 0, 66, 17, 67], ["-", 0, 52, 8, 9, 0, 57, 75, 76, 0, 95], ["-", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]] | 0 | 155 | 6 |
#include <stdio.h>
int main() {
char t[2];
int a, b, o, ab, s;
a = b = o = ab = 0;
while (scanf("%d,%s", &s, t) != EOF) {
if (t[1] == 'B')
ab++;
else if (t[0] == 'A')
a++;
else if (t[0] == 'B')
b++;
else if (t[0] == 'O')
o++;
}
printf("%d\n%d\n%d\n%d\n", a, b, o, ab);... | #include <stdio.h>
int main() {
char t[2];
int a, b, o, ab, s;
a = b = o = ab = 0;
while (scanf("%d,%s", &s, t) != EOF) {
if (t[1] == 'B')
ab++;
else if (t[0] == 'A')
a++;
else if (t[0] == 'B')
b++;
else if (t[0] == 'O')
o++;
}
printf("%d\n%d\n%d\n%d\n", a, b, ab, o);... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 0 | 137 | 4 |
#include <math.h>
#include <stdio.h>
#include <string.h>
int main() {
int a[4], i, num;
for (i = 0; i < 4; i++)
a[i] = 0;
char str[2] = "kk";
while (scanf("%d,%s", &num, str) != EOF) {
if (str[0] == 'A') {
if (str[1] == 'B')
a[2]++;
else
a[0]++;
}
if (str[0] == 'B')
... | #include <math.h>
#include <stdio.h>
#include <string.h>
int main() {
int a[4], i, num;
for (i = 0; i < 4; i++)
a[i] = 0;
char str[2] = "kk";
while (scanf("%d,%s", &num, str) != EOF) {
if (str[0] == 'A') {
if (str[1] == 'B')
a[2]++;
else
a[0]++;
}
if (str[0] == 'B')
... | [["+", 8, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["+", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 8, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 7, 8, 1, 0, 2, 3, 4, 0, 21]] | 0 | 174 | 5 |
#include <stdio.h>
int main(void) {
int n;
char str[4];
int a[4];
int i;
for (i = 0; i < 4; i++) {
a[i] = 0;
}
while (scanf("%d,%s", &n, str) != EOF) {
if (strcmp(str, "A") == 0) {
a[0]++;
} else if (strcmp(str, "B") == 0) {
a[1]++;
} else if (strcmp(str, "O") == 0) {
... | #include <stdio.h>
int main(void) {
int n;
char str[4];
int a[4];
int i;
for (i = 0; i < 4; i++) {
a[i] = 0;
}
while (scanf("%d,%s", &n, str) != EOF) {
if (strcmp(str, "A") == 0) {
a[0]++;
} else if (strcmp(str, "B") == 0) {
a[1]++;
} else if (strcmp(str, "AB") == 0) {
... | [["-", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6]] | 0 | 187 | 4 |
#include <ctype.h>
#include <stdio.h>
#include <string.h>
int main() {
int i;
int a = 0;
int b = 0;
int ab = 0;
int o = 0;
char str[10];
while (1) {
if (scanf("%d,%s", &i, str) == -1)
break;
if (str[0] == 'A') {
if (str[1] == 'B') {
ab = ab + 1;
} else {
a = a + ... | #include <ctype.h>
#include <stdio.h>
#include <string.h>
int main() {
int i;
int a = 0;
int b = 0;
int ab = 0;
int o = 0;
char str[10];
while (1) {
if (scanf("%d,%s", &i, str) == EOF)
break;
if (str[0] == 'A') {
if (str[1] == 'B') {
ab = ab + 1;
} else {
a = a +... | [["-", 8, 9, 0, 57, 15, 23, 0, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 22], ["+", 0, 57, 75, 76, 0, 57, 64, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]] | 0 | 189 | 4 |
<?php
$line = trim(fgets(STDIN));
$line = str_replace('apple', 'りんご', $line);
$line = str_replace('peach', 'apple', $line);
$line = str_replace('りんご', 'peanch', $line);
echo $line . "\n"; | <?php
$line = trim(fgets(STDIN));
$line = str_replace('apple', 'りんご', $line);
$line = str_replace('peach', 'apple', $line);
$line = str_replace('りんご', 'peach', $line);
echo $line . "\n"; | [["-", 12, 613, 3, 3, 0, 28, 0, 557, 0, 610], ["+", 12, 613, 3, 3, 0, 28, 0, 557, 0, 610]] | 6 | 71 | 2 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
str = str.replaceAll("apple", "???");
str = str.replaceAll("peach", "apple");
str = str.replaceAll("???", "peach");
System.out.println(str)... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
str = str.replace("apple", "/");
str = str.replace("peach", "apple");
str = str.replace("/", "peach");
System.out.println(str);
sc.clos... | [["-", 8, 196, 0, 1, 0, 11, 12, 492, 141, 22], ["+", 8, 196, 0, 1, 0, 11, 12, 492, 141, 22], ["-", 0, 11, 12, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 11, 12, 492, 3, 4, 0, 5, 0, 491]] | 3 | 104 | 10 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader reader =
new BufferedReader(new InputStreamReader(System.in));
String str = reader.readLine();
str = str.re... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader reader =
new BufferedReader(new InputStreamReader(System.in));
String str = reader.readLine();
str = str.re... | [["-", 0, 11, 12, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 11, 12, 492, 3, 4, 0, 5, 0, 491]] | 3 | 124 | 6 |
import static java.lang.System.*;
import java.util.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
String s = sc.next();
s = s.replaceAll("apple", "A");
s = s.replaceAll("peach", "apple");
s = s.replaceAll("A", "peach");
out.println(s... | import static java.lang.System.*;
import java.util.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
String s = sc.nextLine();
s = s.replaceAll("apple", "AAAAA");
s = s.replaceAll("peach", "apple");
s = s.replaceAll("AAAAA", "peach");
o... | [["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["-", 0, 11, 12, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 11, 12, 492, 3, 4, 0, 5, 0, 491]] | 3 | 107 | 6 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
while (s.hasNext()) {
String t = s.nextLine();
t.replace("apple", "\n");
t.replace("peach", "apple");
t.replace("\n", "peach");
System.out.println(t);
}
}
} | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
while (s.hasNext()) {
String t = s.nextLine();
t = t.replace("apple", "\n");
t = t.replace("peach", "apple");
t = t.replace("\n", "peach");
System.out.println(t);... | [["+", 0, 52, 8, 196, 0, 1, 0, 11, 17, 32], ["+", 8, 196, 0, 1, 0, 11, 12, 492, 500, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 31, 22]] | 3 | 102 | 6 |
import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
static char[] in;
public static void main(String[] args) {
while (read()) {
solve();
}
}
static boolean read() {
if (!sc.hasNext())
return false;
in = sc.next().toCharArray();
return tru... | import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
static char[] in;
public static void main(String[] args) {
while (read()) {
solve();
}
}
static boolean read() {
if (!sc.hasNext())
return false;
in = sc.nextLine().toCharArray();
return... | [["-", 0, 1, 0, 11, 12, 492, 500, 492, 141, 22], ["+", 0, 1, 0, 11, 12, 492, 500, 492, 141, 22]] | 3 | 305 | 2 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s;
s = sc.nextLine();
s = s.replaceAll("apple", "tmpP");
s = s.replaceAll("peach", "tmpA");
s = s.replaceAll("tmpOfP", "peach");
s = s.replaceAll("tmpOfA",... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s;
s = sc.nextLine();
s = s.replaceAll("apple", "tmpP");
s = s.replaceAll("peach", "tmpA");
s = s.replaceAll("tmpP", "peach");
s = s.replaceAll("tmpA", "ap... | [["-", 0, 11, 12, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 11, 12, 492, 3, 4, 0, 5, 0, 491]] | 3 | 115 | 4 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
class Main {
public static void main(String[] args) throws IOException {
doit(args, System.in, System.out);
}
static void doit(String[] args, InputStream in, ... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
class Main {
public static void main(String[] args) throws IOException {
doit(args, System.in, System.out);
}
static void doit(String[] args, InputStream in, ... | [["-", 8, 196, 0, 1, 0, 11, 12, 492, 500, 22], ["+", 8, 196, 0, 1, 0, 11, 12, 492, 500, 22]] | 3 | 160 | 4 |
import java.util.*;
public class Main {
Scanner sc = new Scanner(System.in);
public static void main(String[] args) { new Main().run(); }
void run() {
while (sc.hasNext()) {
String sen = sc.nextLine();
sen.replaceAll("apple", "!!!");
sen.replaceAll("peach", "apple");
sen.replaceAll("!... | import java.util.*;
public class Main {
Scanner sc = new Scanner(System.in);
public static void main(String[] args) { new Main().run(); }
void run() {
while (sc.hasNext()) {
String sen = sc.nextLine();
sen = sen.replaceAll("apple", "!!!");
sen = sen.replaceAll("peach", "apple");
sen =... | [["+", 0, 52, 8, 196, 0, 1, 0, 11, 17, 32], ["+", 8, 196, 0, 1, 0, 11, 12, 492, 500, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 31, 22]] | 3 | 117 | 6 |
#include <stdio.h>
int main() {
int i;
char s[1001];
for (i = 0;; i++) {
scanf("%c", &s[i]);
if (s[i] == '\n')
break;
}
s[i] = '\0';
for (i = 0; s[i] != '\n'; i++) {
if (s[i] == 'a') {
if (s[i + 1] == 'p' && s[i + 2] == 'p' && s[i + 3] == 'l' &&
s[i + 4] == 'e') {
... | #include <stdio.h>
int main() {
int i;
char s[1001];
for (i = 0;; i++) {
scanf("%c", &s[i]);
if (s[i] == '\n')
break;
}
s[i] = '\0';
for (i = 0; s[i + 4] != '\0'; i++) {
if (s[i] == 'a') {
if (s[i + 1] == 'p' && s[i + 2] == 'p' && s[i + 3] == 'l' &&
s[i + 4] == 'e') {
... | [["+", 0, 7, 15, 16, 31, 69, 71, 16, 17, 72], ["+", 0, 7, 15, 16, 31, 69, 71, 16, 12, 13], ["-", 8, 9, 0, 7, 15, 16, 12, 103, 0, 44], ["+", 8, 9, 0, 7, 15, 16, 12, 103, 0, 44]] | 0 | 318 | 4 |
#include <stdio.h>
#include <string.h>
#define SIZE 1028
char str[SIZE];
void apple(int len);
int main() {
int len;
fgets(str, sizeof(str), stdin);
len = strlen(str) - 1;
apple(len);
printf("%s", str);
return 0;
}
void apple(int len) {
int i;
for (i = 0; i < len; i++) {
if (strncmp(&str[i], "apple... | #include <stdio.h>
#include <string.h>
#define SIZE 1028
char str[SIZE];
void apple(int len);
int main() {
int len;
fgets(str, sizeof(str), stdin);
len = strlen(str) - 1;
apple(len);
printf("%s", str);
return 0;
}
void apple(int len) {
int i;
for (i = 0; i < len; i++) {
if (strncmp(&str[i], "apple... | [["-", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 162 | 4 |
#include <stdio.h>
#include <string.h>
int main(void) {
char text[1024];
int i, n;
fgets(text, 1024, stdin);
n = strlen(text);
for (i = 0; i < n - 5; i++) {
if (strncmp(&text[i], "apple", 5) == 0) {
memcpy(&text[i], "peach", 5);
}
if (strncmp(&text[i], "peach", 5) == 0) {
memcpy(&text... | #include <stdio.h>
#include <string.h>
int main(void) {
char text[1024];
int i, n;
fgets(text, 1024, stdin);
n = strlen(text);
for (i = 0; i < n - 5; i++) {
if (strncmp(&text[i], "apple", 5) == 0) {
memcpy(&text[i], "peach", 5);
} else if (strncmp(&text[i], "peach", 5) == 0) {
memcpy(&tex... | [["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]] | 0 | 139 | 1 |
#include <stdio.h>
int main() {
char moji[1001] = {'\0'};
int i, b = 0;
while (scanf("%s", moji) != EOF) {
if (b != 0) {
printf(" ");
}
for (i = 0; i < 996; i++) {
if (moji[i] == 'a' && moji[i + 1] == 'p' && moji[i + 2] == 'p' &&
moji[i + 3] == 'l' && moji[i + 4] == 'e') {
... | #include <stdio.h>
int main() {
char moji[1001] = {'\0'};
int i, b = 0;
while (scanf("%s", moji) != EOF) {
if (b != 0) {
printf(" ");
}
b++;
for (i = 0; i < 996; i++) {
if (moji[i] == 'a' && moji[i + 1] == 'p' && moji[i + 2] == 'p' &&
moji[i + 3] == 'l' && moji[i + 4] == 'e... | [["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]] | 0 | 316 | 3 |
#include <stdio.h>
#include <string.h>
int main() {
char data[1100];
int i = 0;
fgets(data, sizeof(data), stdin);
for (i = 1; data[i] != 0; i++) {
if (i >= 4) {
if (data[i - 4] == 'a') {
if (data[i - 3] == 'p') {
if (data[i - 2] == 'p') {
if (data[i - 1] == 'l') {
... | #include <stdio.h>
#include <string.h>
int main() {
char data[1100];
int i = 0;
fgets(data, sizeof(data), stdin);
for (i = 1; data[i] != 0; i++) {
if (i >= 4) {
if (data[i - 4] == 'a') {
if (data[i - 3] == 'p') {
if (data[i - 2] == 'p') {
if (data[i - 1] == 'l') {
... | [["+", 64, 9, 0, 57, 64, 9, 0, 116, 0, 117], ["+", 64, 9, 0, 57, 64, 9, 0, 116, 0, 35]] | 0 | 331 | 2 |
#include <stdio.h>
int main(void) {
int i, j, n, m;
char a[1000];
gets(a);
for (i = 0; i < 1000; i++) {
int f = 0;
if (a[i] == 'p')
if (a[i + 1] = 'e')
if (a[i + 2] == 'a')
if (a[i + 3] == 'c')
if (a[i + 4] == 'h')
f = 1;
if (f == 1) {
a[i] = '... | #include <stdio.h>
int main(void) {
int i, j, n, m;
char a[1000];
gets(a);
for (i = 0; i < 1000; i++) {
int f = 0;
if (a[i] == 'p')
if (a[i + 1] == 'e')
if (a[i + 2] == 'a')
if (a[i + 3] == 'c')
if (a[i + 4] == 'h')
f = 1;
if (f == 1) {
a[i] =... | [["-", 0, 57, 64, 57, 15, 23, 0, 11, 17, 32], ["+", 0, 57, 64, 57, 15, 23, 0, 16, 17, 60], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]] | 0 | 327 | 5 |
#include <stdio.h>
#include <string.h>
int main(void) {
int i;
int len;
char str[1024];
fgets(str, 1024, stdin);
len = strlen(str);
for (i = 0; i < len; i++) {
if (strncmp(&str[i], "apple", 5) == 0) {
strncpy(&str[i], "peach", 5);
}
if (strncmp(&str[i], "peach", 5) == 0) {
strncpy... | #include <stdio.h>
#include <string.h>
int main(void) {
int i;
int len;
char str[1024];
fgets(str, 1024, stdin);
len = strlen(str);
for (i = 0; i < len; i++) {
if (strncmp(&str[i], "apple", 5) == 0) {
strncpy(&str[i], "peach", 5);
} else if (strncmp(&str[i], "peach", 5) == 0) {
strncp... | [["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]] | 1 | 140 | 1 |
#include <iostream>
#include <string>
using namespace std;
int main() {
int i, mozisu;
string str;
getline(cin, str);
mozisu = str.size();
for (i = 0; i < mozisu; i++) {
if (str[i] == 'a' && str[i + 1] == 'p' && str[i + 2] == 'p' &&
str[i + 3] == 'l' && str[i + 4] == 'e') {
str[i] = 'p'... | #include <iostream>
#include <string>
using namespace std;
int main() {
int i, mozisu;
string str;
getline(cin, str);
mozisu = str.size();
for (i = 0; i < mozisu; i++) {
if (str[i] == 'a' && str[i + 1] == 'p' && str[i + 2] == 'p' &&
str[i + 3] == 'l' && str[i + 4] == 'e') {
str[i] = 'p'... | [["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]] | 1 | 281 | 1 |
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
int main() {
char input[2000];
cin.getline(input, 1000);
for (int i = 0; input[i] != '\n'; i++) {
if (!strncmp(&input[i], "apple", 5)) {
strncpy(&input[i], "peach", 5);
} else if (!s... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
int main() {
char input[2000];
cin.getline(input, 1000);
for (int i = 0; input[i] != '\0'; i++) {
if (!strncmp(&input[i], "apple", 5)) {
strncpy(&input[i], "peach", 5);
} else if (!s... | [["-", 8, 9, 0, 7, 15, 16, 12, 103, 0, 44], ["+", 8, 9, 0, 7, 15, 16, 12, 103, 0, 44]] | 1 | 140 | 2 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
while (getline(cin, s)) {
for (int i = 0; i < s.size() - 4; i++) {
if (s[i] == 'a') {
if (s[i + 1] == 'p') {
if (s[i + 2] == 'p') {
if (s[i + 3] == 'l') {
if (s[i + 4] == 'e') {... | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
while (getline(cin, s)) {
for (int i = 0; i < s.size() - 4; i++) {
if (s[i] == 'a') {
if (s[i + 1] == 'p') {
if (s[i + 2] == 'p') {
if (s[i + 3] == 'l') {
if (s[i + 4] == 'e') {... | [["+", 64, 9, 0, 57, 64, 9, 0, 116, 0, 117], ["+", 64, 9, 0, 57, 64, 9, 0, 116, 0, 35]] | 1 | 313 | 2 |
#include <bits/stdc++.h>
#define rep(i, l, n) for (int i = l; i < n; i++)
#define rer(i, l, n) for (int i = l; i <= n; i++)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define pb(a) push_back(a)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vint;
... | #include <bits/stdc++.h>
#define rep(i, l, n) for (int i = l; i < n; i++)
#define rer(i, l, n) for (int i = l; i <= n; i++)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define pb(a) push_back(a)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vint;
... | [["-", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6], ["+", 0, 43, 49, 50, 51, 83, 0, 5, 0, 6], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 13]] | 1 | 248 | 6 |
#include <iostream>
#include <string>
using namespace std;
string s;
int main() {
cin >> s;
for (int i = 0; i < s.size() - 4; i++) {
string t = s.substr(i, 5);
if (t == "apple")
s.replace(s.begin() + i, s.begin() + i + 5, "peach");
if (t == "peach")
s.replace(s.begin() + i, s.begin() + i + 5... | #include <iostream>
#include <string>
using namespace std;
string s;
int main() {
getline(cin, s);
for (int i = 0; i < s.size() - 4; i++) {
string t = s.substr(i, 5);
if (t == "apple")
s.replace(s.begin() + i, s.begin() + i + 5, "peach");
if (t == "peach")
s.replace(s.begin() + i, s.begin() ... | [["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25]] | 1 | 131 | 5 |
#include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class t> using table = vector<vector<t>>;
const ld eps = 1e-9;
//// < "d:\d_download\visual studio
///2015\projects\programing_contest_c++\debug\a.txt" > "d:... | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class t> using table = vector<vector<t>>;
const ld eps = 1e-9;
//// < "d:\d_download\visual studio
///2015\projects\programing_contest_c++\debug\a.txt" > "d:... | [["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 158 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.