Search is not available for this dataset
name stringlengths 2 112 | description stringlengths 29 13k | source int64 1 7 | difficulty int64 0 25 | solution stringlengths 7 983k | language stringclasses 4
values |
|---|---|---|---|---|---|
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
int main() {
string a, b, c, d;
cin >> a >> b >> c >> d;
int first = a.size() - 2;
int second = b.size() - 2;
int z = c.size() - 2;
int w = d.size() - 2;
int n = 0, m = 0;
if ((first <= second / 2) && (first <= z / 2) && (first <= w / 2)) {
++n;
a = ... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import sys
lines = sys.stdin.readlines()
lines = map(lambda x: x.strip(), lines)
lengths = []
mapping = {}
for line in lines:
a, b = line.split('.')
lengths.append(len(b))
mapping[len(b)] = a
lengths.sort()
a = lengths[0] * 2 <= lengths[1]
b = lengths[-1] >= lengths[-2] * 2
if a and not b:
prin... | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | a=len(input())-2
b=len(input())-2
c=len(input())-2
d=len(input())-2
cnt=0
ans='e'
if (a>=b*2 and a>=c*2 and a>=d*2) or (a*2<=b and a*2<=c and a*2<=d) :
ans='A'
cnt+=1
a , b = b , a
if (a>=b*2 and a>=c*2 and a>=d*2) or (a*2<=b and a*2<=c and a*2<=d) :
ans='B'
cnt+=1
a,c=c,a
if (a>=b*2 and a>=c*2 and a>=... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | a=[len(raw_input()[2:]) for i in range(4)]
ans='ABCD'
ii=0
cnt=0
for i in range(4):
_short, _long = 0, 0
for j in range(4):
if i!=j and a[i]>=2*a[j]:
_long+=1
if i!=j and a[i]*2<=a[j]:
_short+=1
if _short==3 or _long==3:
ii=i
cnt+=1
if cnt==1:
pri... | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | l=[]
ans=[1]*4
for i in range(4):
s=raw_input()
chk=len(s)-2
# chk-=s.count('_')
l.append(chk)
a=max(l)
i=min(l)
for x in range(4):
if l[x]!=a and l[x]!=i:
ans[x]=0
else:
for y in range(4):
if x==y:
pass
elif l[x]==a and l[y]*2>a:
... | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.util.Scanner;
public class solu_11 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String a = in.next();
String b = in.next();
String c = in.next();
String d = in.next();
int tam1 = a.substring(2, a.length()).length();
... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | # Description of the problem can be found at http://codeforces.com/problemset/problem/437/A
max_i = -1
max_l = "A"
min_i = -1
min_l = 100
c = "E"
l_s = list()
for _ in range(4):
l_s.append(input())
l_s.sort(key = lambda x: len(x))
if (len(l_s[0]) - 2) * 2 <= len(l_s[1]) - 2:
if len(l_s[3]) - 2 >= (len(l_s[... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s[4];
int size[4];
for (int i = 0; i < 4; i++) {
cin >> s[i];
size[i] = s[i].size() - 2;
}
int c1 = 0, c2 = 0, f = 0;
char choice;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if (i != j) {
if (size[... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
vector<string> v(4);
vector<char> X;
for (int i = 0; i < 4; i++) {
cin >> v[i];
}
int c, j, i, k;
bool f = false;
for (i = 0; i < 4; i++) {
c = 0;
k = 0;
for (j = 0; j < 4; j++) {
if (i != j) {... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | a=[0,0,0,0]
ans_str=['A','B','C','D']
def is_great(_index):
for i in range(4):
if a[_index] < (a[i]*2) and _index != i:
return False
return True
def is_smaller(_index):
for i in range(4):
if a[_index]*2 > a[i] and _index != i:
return False
return True
for i in range(4):
a[i]=len(raw_input())-2
ans=-1
... | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s1, s2, s3, s4;
cin >> s1 >> s2 >> s3 >> s4;
int n1 = s1.size() - 2;
int n2 = s2.size() - 2;
int n3 = s3.size() - 2;
int n4 = s4.size() - 2;
int a = 0, b = 0, c = 0, d = 0;
if ((2 * n1 <= n2 && 2 * n1 <= n3 && 2 * n1 <= n4) ||
(n1 >... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
impor... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | r=[]
for i in range(4):
r+=[raw_input()]
r[i]=len(r[i])-2
w=r[:]
w.sort()
if 2*w[0]>w[1] and 2*w[2]>w[-1]:
print'C'
if 2*w[0]<=w[1]:
if 2*w[2]<=w[-1]:
print 'C'
else:
print '%c'%chr(ord('A')+(r.index(w[0])))
if 2*w[0]>w[1] and 2*w[2]<=w[-1]:
print '%c'%chr(ord('A')+(r.index(w[-1]... | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #!/usr/bin/env python3
choice = list()
for i in range(4):
choice.append(len(input())-2)
great = -1
for i in range(4):
shorter = 0
longer = 0
for j in range(4):
if j == i:
continue
if 2*choice[i] <= choice[j]:
shorter += 1
if choice[i] >= 2*choice[j]:
longer += 1
if shorter == 3 or longer == 3:
if ... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.util.Scanner;
public class homework {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int[] a = new int[4];
for (int i = 0; i < a.length; i++)
a[i] = sc.nextLine().length() - 2;
int k1 = 0;
String x = "";
for (int ... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | def getChar(x):
if x == 0:
return 'A'
if x == 1:
return 'B'
if x == 2:
return 'C'
return 'D'
arr = []
for i in range(4):
s = input()
arr.append((i,s[2:]))
for i in range(4):
for j in range(i + 1, 4):
if len(arr[j][1]) < len(arr[i][1]):
tmp = arr[j]
arr[j] = arr[i]
arr[i] = tmp
counter = 0
gre... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | mod = 1000000007
MOD = 998244353
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
it = lambda : tuple(map(int, input().split()))
ls = lambda : list(input())
l = []
for i in range(4):
s ... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
const int N = 300000;
bool used[5];
bool check(int k1, int k2, int k3, int k4) {
if (k1 >= 2 * k2 && k1 >= 2 * k3 && k1 >= 2 * k4) return true;
if (2 * k1 <= k2 && 2 * k1 <= k3 && 2 * k1 <= k4) return true;
return false;
}
int main() {
string s1, s2, s3, s4;
cin >... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
int gcd(int a, int b) {
int r, i;
while (b != 0) {
r = a % b;
a = b;
b = r;
}
return a;
}
struct ax {
int s;
char in;
};
bool cmp(struct ax a, struct ax b) { return a.s < b.s; }
int main() {
char a[10010];
char b[1... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | a = len(input()) - 2
b = len(input()) - 2
c = len(input()) - 2
d = len(input()) - 2
l = [(a, "A"), (b, "B"), (c, "C"), (d, "D")]
l.sort()
s = False
#print(l)
if l[0][0] * 2 <= l[1][0]:
s = l[0][1]
if l[2][0] * 2 <= l[3][0]:
if s:
print("C")
exit()
s = l[3][1]
if s:
print(s)
else: ... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
const long long inf = 0x3f3f3f3f;
string a, b, c, d;
int n[5];
char tc[5];
int main() {
std::ios::sync_with_stdio(0);
cin >> a >> b >> c >> d;
int cnt = 0, id;
tc[1] = 'A', tc[2] = 'B', tc[3] = 'C', tc[4] = 'D';
n[1] = int((a).size()) - 2, n[2] = int((b).size()) -... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | # -*- coding: utf-8 -*-
a = [len(input()[2:]), 'A']
b = [len(input()[2:]), 'B']
c = [len(input()[2:]), 'C']
d = [len(input()[2:]), 'D']
ans = None
l = list(sorted([a, b, c, d]))
if l[0][0] * 2 <= l[1][0] and l[2][0] * 2 > l[3][0]:
ans = l[0][1]
elif l[2][0] * 2 <= l[3][0] and l[0][0] * 2 > l[1][0]:
ans = l[3... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | # Codeforces Problemset
# 437A
a = len(input()) - 2
b = len(input()) - 2
c = len(input()) - 2
d = len(input()) - 2
great = []
if 2*a <= b and 2*a <= c and 2*a <= d:
great.append('A')
elif 2*b <= a and 2*b <= c and 2*b <= d:
great.append('B')
elif 2*c <= a and 2*c <= b and 2*c <= d:
great.append('C')
el... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
int main() {
string a, b, c, d;
cin >> a >> b >> c >> d;
int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
if ((a.size() - 2) >= (b.size() - 2) * 2 &&
(a.size() - 2) >= (c.size() - 2) * 2 &&
(a.size() - 2) >= (d.size() - 2) * 2) {
c1 = 1;
} else if ((a.size() - ... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
string a, b, c, d, ans;
int z, y, x, k, cnt;
int main() {
cin >> a >> b >> c >> d;
x = a.size() - 2;
y = b.size() - 2;
z = c.size() - 2;
k = d.size() - 2;
if (x <= y / 2 && x <= z / 2 && x <= k / 2 ||
y * 2 <= x && z * 2 <= x && k * 2 <= x) {
cnt++;
... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | a = sorted([(len(input()) - 2, i) for i in 'ABCD'])
p = 0
if a[0][0] * 2 <= a[1][0]:
p += 1
if a[-2][0] * 2 <= a[-1][0]:
p += 2
print(['C', a[0][1], a[-1][1], 'C'][p])
| PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
int main() {
string temp = "ABCD";
char res, a, b;
int count = 0;
bool check[4][2];
string choice[4];
for (int i = 0; i < 4; i++) check[i][0] = check[i][1] = 1;
for (int i = 0; i < 4; i++) cin >> a >> b >> choice[i];
for (int i = 0; i < 4; i++) {
for (in... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.util.Scanner;
public class CF {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String a = sc.next().substring(2);
String b = sc.next().substring(2);
String c = sc.next().substring(2);
String d = sc.next().substring(2);
Strin... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
char str[111][111];
int main() {
while (scanf("%s", &str[0]) != EOF) {
scanf("%s", &str[1]);
scanf("%s", &str[2]);
scanf("%s", &str[3]);
int tot = 0, ans;
for (int i = 0; i < 4; i++) {
int a = 0, b = 0;
for (int j = 0; j < 4; j++) {
if (j == i) continue... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
int cnt;
char k;
int main() {
string a, b, c, d;
cin >> a >> b >> c >> d;
int az = a.size() - 2, bz = b.size() - 2, cz = c.size() - 2,
dz = d.size() - 2;
if (az * 2 <= bz && az * 2 <= cz && az * 2 <= dz) {
cnt++;
k = 'A';
}
if (bz * 2 <= az && bz *... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | def check(a,b,c,d):
if (a>=b*2 and a>=c*2 and a>=d*2) or (a*2<=b and a*2<=c and a*2<=d):
return 1
else:
return 0
a=len(input())-2
b=len(input())-2
c=len(input())-2
d=len(input())-2
ans=["A","B","C","D"]
cnt=[check(a,b,c,d),check(b,a,c,d),check(c,a,b,d),check(d,a,b,c)]
if sum(cnt)==1:
for i ... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import sys
def minp():
return sys.stdin.readline().strip()
a = []
for i in range(4):
a.append(minp())
b = a[::]
if len(b[2]) > len(b[3]):
b[2],b[3] = b[3],b[2]
if len(b[1]) > len(b[2]):
b[1],b[2] = b[2],b[1]
if len(b[0]) > len(b[1]):
b[0],b[1] = b[1],b[0]
if len(b[2]) > len(b[3]):
b[2],b[3] = b[3],b[2]
if len(... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | l=input()
l=len(l)-2
l2=input()
l2=len(l2)-2
l3=input()
l3=len(l3)-2
l4=input()
l4=len(l4)-2
m=[l,l2,l3,l4]
m.sort()
pp=0
if((m[1]/m[0])>=2 and (m[2]/m[0])>=2 and (m[3]/m[0])>=2):
pp+=1
if((m[3]/m[0])>=2 and (m[3]/m[1])>=2 and (m[3]/m[2])>=2):
pp+=1
if(pp==1):
if((m[1]/m[0])>=2 and (m[2]/m[0])>=2 and (m[3... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | a = sorted([(len(input()) - 2, i) for i in 'ABCD'])
p = 0
if a[0][0] * 2 <= a[1][0]:
p += 1
if a[-2][0] * 2 <= a[-1][0]:
p += 2
print(['C', a[0][1], a[-1][1], 'C'][p])
# Made By Mostafa_Khaled | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | //package round250;
import java.util.Scanner;
public class a {
public static void main(String[] args) {
Scanner leer=new Scanner(System.in);
int vec[]=new int[4];
int may=Integer.MIN_VALUE;
int men=Integer.MAX_VALUE;
int x=0,y=0;
for (int i = 0; i < vec.length; i++) {
vec[i]=leer.next().length()-2;
... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | from math import *
from collections import *
from sys import *
import string
import re
t=stdin.readline
p=stdout.write
def GI(): return map(int, input().strip().split())
def GS(): return map(str, t().strip().split())
def IL(): return list(map(int, t().strip().split()))
def SL(): return list(map(str, t().strip().split()... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class TheChildAndHomework {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
int[] a = ... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | x, y = {}, {}
def get_len(path):
return int(len(path[1]))
x['A'] = input()
x['B'] = input()
x['C'] = input()
x['D'] = input()
y = sorted(x.items(), key=get_len)
if (len(y[0][1]) - 2) * 2 <= (len(y[1][1]) - 2) and (len(y[3][1]) - 2) < (len(y[2][1]) - 2) * 2:
print( y[0][0] )
elif (len(y[3][1]) - 2) >= (len(y... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #!/usr/bin/python
a=input()
b=input()
c=input()
d=input()
l=[len(a)-2,len(b)-2,len(c)-2,len(d)-2]
counter=0
ans=0
for i in range(0,len(l)):
f=1
for j in range(0,len(l)):
if(i!=j):
if(l[i]<2*l[j]):
f=0
break
if f==1:
counter=counter+1
ans=i
f=1
for j in range(0,len(l)):
if(i!=j):
if(2*l[i]>l... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.util.*;
public class ProB {
static int ans,ju,p;
static String[] aa=new String[4];
static int[] bb=new int[4];
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
for(int i=0;i<4;i++)
{
aa[i]=in.nextLine();
bb[i]=aa[i].length()-2;
}
ans=2;
for(int i=0;i<4;i++)
... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.util.*;
public class TheChildAndHomework {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String A = sc.next();
String B = sc.next();
String C = sc.next();
String D = sc.next();
sc.close();
List<String> ... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | b=[]
for i in range(4):
s=input()
b.append([len(s)-2,s[0]])
b.sort()
if b[1][0]>=2*b[0][0] and b[3][0]>=2*b[2][0]:print('C')
elif b[1][0]>=2*b[0][0]:print(b[0][1])
elif b[3][0]>=2*b[2][0]:print(b[3][1])
else:print('C')
| PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | def main():
CHOICES = ['A', 'B', 'C', 'D']
lines = []
for i in range(4):
lines.append(raw_input())
# print(lines)
lengths = []
for line in lines:
lengths.append(len(line) - 2)
greatChoices = []
for i in range(len(lines)):
condition1 = True
condition... | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
from collections import defaultdict
from math import factorial as f
from fractions import gcd as g
l = []
s = raw_input ()
l.append (len (s) - 2)
s = raw_input ()
l.append (len (s) - 2)
s = raw_input ()
l.append (len (s) - 2)
s = raw_input ()
l.append (len (s) - 2)
ret = ... | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws Exception{
Reader.init(System.in);
int size [] = new int [4] ;
for(... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | # your code goes here
i=0
a=[]
choice=['A','B','C','D']
for j in xrange(4):
line=raw_input()
a.append([line.split('.')[1],len(line.split('.')[1]),choice[i]])
i+=1
choices={}
defaulter={}
for x in a:
for y in a:
if x[2]==y[2]:
continue
else:
if 2*y[1]<=x[1]:
if not defaulter.has_key(x[2]):
if choi... | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Vadim
*/
public class Main {
public s... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | list,temp=[],[]
for i in range(4):
a=input()
list.append(len(a)-2)
temp=list.copy()
temp.sort()
if(2*temp[0]<=temp[1] and temp[3]<(2*temp[2])):
ind=list.index(temp[0])
print(chr(65+ind))
elif(temp[3]>=(2*temp[2]) and 2*temp[0]>temp[1]):
ind=list.index(temp[3])
print(chr(65+ind))
else:
pr... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | c=sorted([(len(raw_input())-2,i) for i in range(4)])
s,l=c[0][0]*2<=c[1][0],c[2][0]*2<=c[3][0]
print 'C' if not s^l else chr(c[l*3][1]+65) | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import sys
from bisect import insort
lines = []
letter_map = {0: "A", 1: "B", 2: "C", 3: "D"}
for i in xrange(4):
insort(lines, (len(sys.stdin.readline().strip()[2:]), i))
lower = 2*lines[0][0] <= lines[1][0]
higher = 2*lines[2][0] <= lines[3][0]
if lower and higher:
print "C"
elif lower:
print letter_map[l... | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | s=[]
for _ in range(4):
t=list(input())
s.append(len(t)-2)
p=s[:]
d=["A","B","C","D"]
s.sort()
sw=0
sw2=0
if s[1] >= 2 * s[0]:
sw = 1
if s[3] >= 2 * s[2]:
sw2 = 1
if sw and not sw2:
print(d[p.index(s[0])])
elif sw2 and not sw:
print(d[p.index(s[3])])
else:
print("C")
| PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | def condition(t, s1, s2, s3):
n1, n2, n3, n4 = len(t[2:]), len(s1[2:]), len(s2[2:]), len(s3[2:])
if n1 >= 2 * n2 and n1 >= 2 * n3 and n1 >= 2 * n4:
return True
elif 2 * n1 <= n2 and 2 * n1 <= n3 and 2 * n1 <= n4:
return True
return False
def homework(lst):
x1 = condition(lst[0], ls... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.util.*;
import java.math.*;
import java.text.*;
import java.io.*;
import java.awt.Point;
import static java.util.Arrays.*;
import static java.lang.Integer.*;
import static java.lang.Double.*;
import static java.lang.Long.*;
import static java.lang.Short.*;
import static java.lang.Math.*;
import static jav... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
int main() {
string a, b, c, d;
cin >> a >> b >> c >> d;
char ans = '*';
int la = a.length() - 2, lb = b.length() - 2, lc = c.length() - 2,
ld = d.length() - 2;
if ((la >= 2 * lb && la >= 2 * lc && la >= 2 * ld) ||
((la * 2 <= lb && la * 2 <= lc && la ... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | a = len( str( raw_input() ) ) - 2
b = len( str( raw_input() ) ) - 2
c = len( str( raw_input() ) ) - 2
d = len( str( raw_input() ) ) - 2
ans = [0] * 4
if ( a >= b * 2 ) and ( a >= c * 2 ) and ( a >= d * 2 ): ans[0] += 1
if ( b >= a * 2 ) and ( b >= c * 2 ) and ( b >= d * 2 ): ans[1] += 1
if ( c >= a * 2 ) and ( c >= b ... | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | if __name__ == '__main__':
s = list()
for _ in range(4):
s.append(len(input()) - 2)
l = sorted(s)
mn, mx = l[0], l[3]
mn = l[0] if l[0] <= l[1] / 2 else 0
mx = l[3] if l[3] >= l[2] * 2 else 0
if not mn and mx:
print(chr(s.index(mx) + ord("A")))
elif mn and not mx:
... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.util.Scanner;
public class TheChildandHomework
{
public static void main(String[] args)
{
Scanner z=new Scanner(System.in);
int[] a=new int[4];
for(int i=0;i<a.length;i++)
a[i]=z.nextLine().length()-2;
int k1=0;
String x="";
for(int i=0;i<a... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | cs = [raw_input() for _ in range(4)]
cs.sort(key=len)
f = lambda x: len(x)-2
t = 0
if 2*f(cs[0]) <= f(cs[1]):
ans = cs[0][0]
t += 1
if f(cs[3]) >= 2*f(cs[2]):
ans = cs[3][0]
t += 1
if t == 0 or t == 2:
ans = 'C'
print ans
| PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 |
a = []
a.append(len(input())-2)
a.append(len(input())-2)
a.append(len(input())-2)
a.append(len(input())-2)
great = []
for i in range(4):
temp = a[i]
shor = True
lon = True
for j in range(4):
if i!= j and a[i]<2*a[j]:
lon = False
if i!= j and a[i]>a[j]//2:
shor =... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | s1=input()
s2=input()
s3=input()
s4=input()
l1=len(s1)-2
l2=len(s2)-2
l3=len(s3)-2
l4=len(s4)-2
l=[l1,l2,l3,l4]
i=l.index(min(l))
r=l.index(max(l))
c1=0
j=0
while j<4:
if j!=i:
if l[i]<=l[j]//2:
j=j+1
else:
c1=1
break
else:
j=j+1
c2=0
j=0
while j<4:
... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Locale;
import java.util.StringTokenizer;
public class B_250 {
static StringTokenizer st;
static BufferedReader b... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 |
import java.io.*;
public class Main
{
public static void main(String args[]) throws java.lang.Exception
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String[] A=new String[4];
int[] B=new int[4];
String s;
int k=0;
for(int i=0;i<4;i++... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.io.*;
import java.util.*;
public class Cf {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//String q[] = br.readLine().split(" ");
//int k = Integer.parseInt(q[0]);
//int d = Integer.parseInt(q[1]);
//String ... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | l = [len(input()) - 2 for _ in range(4)]
res = []
for i in range(4):
if 2 * l[i] <= min(l[:i] + l[i+1:]) or l[i] >= 2 * max(l[:i] + l[i + 1:]):
res.append(i)
print("ABCD"[res[0] if len(res) == 1 else 2]) | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
const int inf = ~0U >> 1;
const int MOD = int(1e9) + 7;
const double EPS = 1e-6;
char s[4][120];
int i, j, ans = -1;
int main() {
int a[4], cnt = 0;
char b[4] = {'A', 'B', 'C', 'D'};
for (i = (0); i <= (3); i++) {
scanf("%s", s[i]);
a[i] = strlen(s[i]) - 2;
... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
int main() {
string a[4];
for (int i = 0; i < 4; i++) cin >> a[i];
int l[4];
for (int i = 0; i < 4; i++) l[i] = a[i].length() - 2;
char c;
int sum = 0;
for (int i = 0; i < 4; i++) {
int sumshort = 0, sumtall = 0;
for (int j = 0; j < 4; j++) {
if ... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | def compare_with_front_element(v,pos):
return v[pos+1][2]/v[pos][2]>=2
def child_choice(v):
v.sort(key=lambda x:x[2])
wonderful_list=[]
if compare_with_front_element(v,0):
wonderful_list.append(v[0][0])
if compare_with_front_element(v,2):
wonderful_list.append(v[3][0])
if len(wonderful_list)==1:
return won... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.util.ArrayList;
import java.util.Scanner;
public class TheChildAndHomework {
public static void main(String[] args)
{
Scanner in=new Scanner(System.in);
String A=in.next();
String B=in.next();
String C=in.next();
String D=in.next();
A=A.substring(2);
... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | s = []
length = [0] * 4
for i in range(4):
s.append(input().rstrip())
s[i] = s[i][2:]
length[i] = len(s[i])
var = []
for i in range(4):
if length[i] >= 2 * max(length[:i] + length[i + 1:]) or length[i] <= min(length[:i] + length[i + 1:]) // 2:
var.append(i)
if len(var) == 1:
print(chr(ord('A... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
using ll = long long int;
using namespace std;
using vec = vector<int>;
int main() {
string s;
vec v(4);
for (int i = 0; i < 4; i++) {
cin >> s;
v[i] = s.size() - 2;
}
bool a = false, b = false;
int ind = -1;
string choice = "ABCD";
int cnt = 0... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | d = {}
ans = 0
cnt = 0
for i in range(4):
x = list(input().split("."))
d[x[0]] = len(x[1])
for x in d.keys():
flag = True
for y in d.keys():
if d[x] > (d[y]/2) and (x != y):
flag = False
if flag:
ans = x
cnt += 1
for x in d.keys():
flag = True
for y i... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | varianti=[input()[2:] for i in range(4)]
lenz=[len(varianti[i]) for i in range(4)]
counter=0
for i in range(4):
dub=lenz[:]
now=dub.pop(i)
c1=0
c2=0
for z in range(3):
if(now/dub[z]>=2):
c1+=1
elif (dub[z]/now>=2):
c2+=1
if c1==3 or c2==3 :
zamecha... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | a=raw_input()
b=raw_input()
c=raw_input()
d=raw_input()
v=[]
v+=[(len(a)-2,'A')]
v+=[(len(b)-2,'B')]
v+=[(len(c)-2,'C')]
v+=[(len(d)-2,'D')]
v.sort()
#print v
f=0
if(2*v[0][0]<=v[1][0]):
if((v[3][0]>=2*v[2][0])):
print 'C'
f=1
else:
f=1
print v[0][1]
elif((v[3][0]>=2*v[2][0])):
print v[3][1]
f=1
if(f==0):
... | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
int main() {
char a, b;
string s[4];
int l[4];
int mn = 2147483647, mx = 0;
int q = 0, w = 0;
for (int i = 0; i < 4; i++) {
cin >> a >> b;
cin >> s[i];
l[i] = s[i].size();
if (mn > l[i]) {
mn = l[i];
q = i;
}
if (mx < l[i]) {
... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | choice=[]
for i in range(4):
choice.append(len(input(' ')[2:]))
Shortest=True
Longest=True
cc=0
ci=None
for i in range(4):
Shortest=True
Longest=True
for j in range(4):
if i==j:continue
if choice[i]<choice[j]*2:Longest=False
if choice[i]*2>choice[j]:Shortest=False
if Shor... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | # 437A
# The Child and Homework
choices = ('A', 'B', 'C', 'D')
counts = list()
counts.append(len(raw_input()) - 2)
counts.append(len(raw_input()) - 2)
counts.append(len(raw_input()) - 2)
counts.append(len(raw_input()) - 2)
result = -1
for i in range(4):
valid = True
oldDiv = -1
for j in range(4):
... | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.util.*;
import java.io.*;
public class A {
public static void main(String[] args) {
new A().solve();
}
public void solve() {
Scanner in = new Scanner(System.in);
String[] s = new String[4];
char[] alpha = {'A', 'B', 'C', 'D'};
for (int i = 0; i < 4; i++... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.io.*;
import java.util.*;
public class Main {
public static void main (String[] args) throws Exception
{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int[] len = new int[4];
boolean[] posib = new boolean[4];
for (int i = 0; i < 4; i++) {
len[i] = in.readLine()... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
string s[4];
string ss = "ABCD", ans;
int r = 0, t = 0, n[4], c = 0;
int main() {
for (int i = 0; i < 4; i++) {
cin >> s[i];
n[i] = s[i].size() - 2;
}
for (int i = 0; i < 4; i++) {
r = 0, t = 0;
for (int j = 0; j < 4; j++) {
if (i != j) {
... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 |
a = list(input())
a.pop(0)
a.pop(0)
b = list(input())
b.pop(0)
b.pop(0)
c = list(input())
c.pop(0)
c.pop(0)
d = list(input())
d.pop(0)
d.pop(0)
list1 = [b,c,d]
list2 = [a,c,d]
list3 = [a,b,c]
list4 = [a,b,d]
empty = []
temp = 1
count = 0
count1 = 0
count2 = 0
for i in range(len(list1)):
if len(a) >= ... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | x = []
x.append((len(input())-2, 'A'))
x.append((len(input())-2, 'B'))
x.append((len(input())-2, 'C'))
x.append((len(input())-2, 'D'))
x.sort()
if x[0][0] * 2 <= x[1][0] and x[2][0] * 2 <= x[3][0]:
print('C')
else:
if x[0][0] * 2 <= x[1][0]:
print(x[0][1])
else:
if x[2][0] * 2 <= x[3][0]:
... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | """
Codeforces Round 250 Div 2 Problem A
Author : chaotic_iak
Language: Python 3.3.4
"""
class IOHandlerObject(object):
def getInput(self, mode=2):
# 0: String
# 1: List of strings
# 2: List of integers
inputs = input().strip()
if mode == 0:
return inputs
... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | a=input()
b=input()
c=input()
d=input()
a1=len(a)-2
b1=len(b)-2
c1=len(c)-2
d1=len(d)-2
v=[a1,b1,c1,d1]
p=[]
god=[]
for i in range(4):
k=[]
for j in range(4):
if i!=j:
k.append(v[i]/v[j])
p.append(k)
for i in range(4):
t=0
k=0
for j in range(3):
if p[i][j]>=2:
... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
int a[4];
char rez;
int r = 0;
for (int k = 0; k < 4; k++) {
cin >> s;
a[k] = s.size() - 2;
}
for (int k = 0; k < 4; k++) {
int shorter = 0, longer = 0;
for (int i = 0; i < 4; i++) {
if (k != i) {
if (a[k] *... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MV = 300008;
const int ME = 2000006;
const int MOD = 1000000007;
char str[7][1000];
int a[7];
int main() {
while (~scanf("%s", str[0])) {
for (int i = 1; i < 4; i++) scanf("%s", str[i]);
for (int i = 0; i < 4; i++) {
a[i... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class CodeForce_250A {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
S... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | s1=input()
s2=input()
s3=input()
s4=input()
x1=len(s1)-2;
x2=len(s2)-2;
x3=len(s3)-2;
x4=len(s4)-2;
a=[]
a.append((x1,1))
a.append((x2,2))
a.append((x3,3))
a.append((x4,4))
d={1:"A",2:"B",3:"C",4:"D"}
a.sort()
f1=0
f2=0
if((a[0][0]<=a[1][0]//2 and a[0][0]<=a[2][0]//2 and a[0][0]<=a[3][0]//2)):
f1=1
if((a[3][0]>=a[0][... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | a = input()
b = input()
c = input()
d = input()
a = a[2:]
flag = 0
b = b[2:]
c = c[2:]
d = d[2:]
a = len(a)
b = len(b)
c = len(c)
d = len(d)
ans = []
ans.append((a, 'A'))
ans.append((b, 'B'))
ans.append((c, 'C'))
ans.append((d, 'D'))
ans.sort()
answer = []
if ans[1][0] / ans[0][0] >= 2:
answer.append(ans[0][1])
if ... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | def solve(q):
l = [len(x) for x in q]
g = []
for i in range(4):
f = True
for j in range(4):
if i == j: continue
if l[i]*2 > l[j]: f = False
if f:
g.append(i)
continue
f = True
for j in range(4):
if i == j: continue
if l[i] < l[j]*2: f = False
if f:
... | PYTHON |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
vector<string> split(const string &, char);
vector<string> &split(const string &, char, vector<string> &);
bool compare(int, int);
int main() {
vector<int> length, sorting;
vector<string>::iterator it;
vector<int>::iterator init;
int i, decide = 0;
string test;
... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | a=[]
b=[]
x=[]
for i in range(4):
a.append(input())
b.append(a[i][2:])
x.append(len(b[i]))
f1=int(0)
f2=int(0)
for i in range(4):
if(i!=x.index(max(x))):
if(2*x[i]<=max(x)):
f1=1
else:
f1=0
break
for i in range(4):
if(i!=x.index(min(x))):
... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
int main() {
char a;
int k = 0;
string A, B, C, D;
cin >> A >> B >> C >> D;
int aa, bb, cc, dd;
aa = A.length() - 2;
bb = B.length() - 2;
cc = C.length() - 2;
dd = D.length() - 2;
if ((2 * aa <= bb && 2 * aa <= cc && 2 * aa <= dd) ||
(aa >= 2 * bb ... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.util.*;
public class A1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sca=new Scanner(System.in);
int ai[]=new int[5];
int bi[]=new int[5];
while(sca.hasNext()){
for(int i=1;i<=4;i++){
ai[i]=sca.... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | //package codeforces;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.util.TreeSet;
public class A {
BufferedReader reader = new BufferedReader(... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
39/15 = 2
*
* */
public class A_Div2_250 {
public static void main(String[]arg) throws IOException
{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int i,j,k,l;
... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
const int INF = 99999999;
const int MX = 1000 + 10;
using namespace std;
char s1[MX], s2[MX], s3[MX], s4[MX];
bool judge(int x1, int x2, int x3, int x4) {
if ((x1 * 2 <= x2 && x1 * 2 <= x3 && x1 * 2 <= x4) ||
(x1 >= x2 * 2 && x1 >= x3 * 2 && x1 >= x4 * 2))
retur... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | #include <bits/stdc++.h>
using namespace std;
string s1, s2, s3, s4;
int i, a, b, c, d, n, x[5];
int main() {
cin >> s1;
cin >> s2;
cin >> s3;
cin >> s4;
a = s1.size() - 2;
b = s2.size() - 2;
c = s3.size() - 2;
d = s4.size() - 2;
if ((a * 2 <= b && a * 2 <= c && a * 2 <= d) ||
(a >= 2 * b && a >... | CPP |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | a = [len(input()) - 2 for i in range(4)]
cnt = 0
res = 2
for i in range(4):
flag1 = True
flag2 = True
for j in range(4):
if j != i:
if a[i] < a[j] * 2:
flag1 = False
if a[i] * 2 > a[j]:
flag2 = False
if flag1 or flag2:
cnt += 1
... | PYTHON3 |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 | import java.util.Scanner;
public class P7 {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
String a = s.substring(2, s.length());
s = sc.nextLine();
String b = s.substring(2,s.length());
s = sc.nextLine();
... | JAVA |
437_A. The Child and Homework | Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.
Fortunately the child knows how to solve such complicated test. The chi... | 2 | 7 |
import java.util.Scanner;
public class TheChildAndHomework {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String[] arc = new String[4];
int j=0;
while(j<4 && sc.hasNextLine()){
arc[j]=sc.nextLine();
j++;
}
sc.close();
String[] des = new String[arc.length];
... | JAVA |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.