Problem:


視力検査

視力検査の検査結果データを入力とし、下記の視力判定表に基づいて各判定に当てはまる人数を、左右の視力別に出力するプログラムを作成してください。

判定視力

A1.1 以上

B0.6 以上 1.1 未満

C0.2 以上 0.6 未満

D0.2 未満

Input

入力は以下の形式で与えられます。

l1 r1
l2 r2
l3 r3
:
:

i 行目に i 人目の左の視力を表す実数 li と右の視力を表す実数 ri が空白区切りで与えられます。ただし、視力は 0.1 以上 2.0 以下で、 0.1 刻みで与えられます。

入力の行数は 40 を超えません。

Output

以下の形式で、判定表を出力してください。

1行目 左の視力がAの人数 右の視力がAの人数（空白区切り）

2行目 左の視力がBの人数 右の視力がBの人数（空白区切り）

3行目 左の視力がCの人数 右の視力がCの人数（空白区切り）

4行目 左の視力がDの人数 右の視力がDの人数（空白区切り）

Sample Input

1.0 1.2
0.8 1.5
1.2 0.7
2.0 2.0

Output for the Sample Input

2 3
2 1
0 0
0 0



Sample input:
1.0 1.2
0.8 1.5
1.2 0.7
2.0 2.0


Sample output:
2 3
2 1
0 0
0 0

Submission status: Wrong Answer

Solution code:
def hantei(l):
    if l >= 1.1:
        return 'A'
    elif 0.6 <= l < 1.1:
        return 'B'
    elif 0.2 <= l < 0.6:
        return 'C'
    elif l  < 0.2 :
        return 'D'

ldic = {'A':0, 'B':0, 'C':0, 'D':0}
rdic = {'A':0, 'B':0, 'C':0, 'D':0}
ls = []
while True:
    try:
        l,r = map(float,raw_input().split())
        ls.append((l,r))
    except EOFError:
        break
        
for i,j in ls:
    ldic[hantei(i)] += 1
    rdic[hantei(j)] += 1
    
for L,R in zip(sorted(ldic),sorted(rdic)):
    print L,R

Submission status: Wrong Answer

Solution code:
def hantei(l):
    if l >= 1.1:
        return 'A'
    elif 0.6 <= l < 1.1:
        return 'B'
    elif 0.2 <= l < 0.6:
        return 'C'
    elif l  < 0.2 :
        return 'D'

ldic = {'A':0, 'B':0, 'C':0, 'D':0}
rdic = {'A':0, 'B':0, 'C':0, 'D':0}
ls = []
while True:
    try:
        l,r = map(float,raw_input().split())
        ls.append((l,r))
    except EOFError:
        break
        
for i,j in ls:
    ldic[hantei(i)] += 1
    rdic[hantei(j)] += 1
    
for L,R in zip(sorted(ldic.items(),key = lambda x:x[1]),sorted(rdic.items(),key = lambda x:x[1])):
    print L,R

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys
import os

A = [0, 0]
B = [0, 0]
C = [0, 0]
D = [0, 0]

for s in sys.stdin:
    l, r = map(float, s.split())

    if l >= 1.1:
        A[0] += 1
    elif l >= 0.6:
        B[0] += 1
    elif l >= 0.2:
        C[0] += 1
    else:
        D[0] += 1

    if r >= 1.1:
        A[1] += 1
    elif l >= 0.6:
        B[1] += 1
    elif l >= 0.2:
        C[1] += 1
    else:
        D[1] += 1

print(*A)
print(*B)
print(*C)
print(*D)

Submission status: Wrong Answer

Solution code:
ref = [1.1,0.6,0.2,0.0]
rank = [[0,0] for i in range(4)]
while True:
    try:
        eye = map(float, raw_input().split())
        for i in range(2): 
            for j in range(4):
                if eye[i] >= ref[j]: rank[j][i] += 1
                break
    except:
        break

    print (" ".join(map(str, rank[i])) for i in range(4))

Submission status: Wrong Answer

Solution code:
r = [[0,0] for i in range(4)]
while True:
    try:
        e = map(float, raw_input().split())
        for i in [0,1]: 
            for j in [1.1,0.6,0.2,0.0]:
                if e[i] >= j:
                	r[j][i] += 1
                	break
    except:
        break
for i in range(4):
	print r[i][0],r[i][1]

Submission status: Accepted

Solution code:
import sys
def f(x):
  x = float(x)
  f = 0
  if x<.2: f = 3
  elif x<.6: f = 2
  elif x<1.1: f = 1
  return f

C1=[0]*4
C2=[0]*4
for s in sys.stdin:
  L, R = map(f,s.split())
  C1[L]+=1
  C2[R]+=1
for a,b in zip(C1,C2):
  print a,b

Submission status: Accepted

Solution code:
import sys
def f(x):
  return [3,3,2,2,2,2,1,1,1,1,1,0][min(11,int(float(x)*10))]

C1=[0]*4
C2=[0]*4
for s in sys.stdin:
  L, R = map(f,s.split())
  C1[L]+=1
  C2[R]+=1
for a,b in zip(C1,C2):
  print a,b

Submission status: Accepted

Solution code:
#! -*- coding:utf-8 -*-

ans = [ [0, 0] for _ in xrange(4) ]

def get(x):
	if x >= 1.1: return 0
	if x >= 0.6: return 1
	if x >= 0.2: return 2
	return 3

while True:
	try:
		a, b = [ float(_) for _ in raw_input().split() ]
	except:
		break
	ans[get(a)][0] += 1
	ans[get(b)][1] += 1

for an in ans:
	print an[0], an[1]

Submission status: Accepted

Solution code:
def hantei(l):
    if l >= 1.1:
        return 'A'
    elif 0.6 <= l < 1.1:
        return 'B'
    elif 0.2 <= l < 0.6:
        return 'C'
    elif l  < 0.2 :
        return 'D'

ldic = {'A':0, 'B':0, 'C':0, 'D':0}
rdic = {'A':0, 'B':0, 'C':0, 'D':0}
ls = []
while True:
    try:
        l,r = map(float,raw_input().split())
        ls.append((l,r))
    except EOFError:
        break
        
for i,j in ls:
    ldic[hantei(i)] += 1
    rdic[hantei(j)] += 1
    
for L,R in zip(sorted(ldic),sorted(rdic)):
    print ldic[L],rdic[R]

Submission status: Accepted

Solution code:
res = [[0,0] for i in range(4)]
while True:
    try:
        for i, v in enumerate(map(float, raw_input().split())):
            if 1.1 <= v:
                res[0][i] = res[0][i]+1
            elif 0.6 <= v:
                res[1][i] = res[1][i]+1
            elif 0.2 <= v:
                res[2][i] = res[2][i]+1
            else:
                res[3][i] = res[3][i]+1
    except EOFError:
        for v in res:
            print v[0], v[1]
        break

Submission status: Accepted

Solution code:
def calc(i):
    if i<0.2:return 3
    elif 0.2<=i<0.6:return 2
    elif 0.6<=i<1.1:return 1
    else:return 0

r_ans=[0]*4
l_ans=[0]*4
while 1:
    try:
        l,r=map(float,raw_input().split())
        l_ans[calc(l)]+=1
        r_ans[calc(r)]+=1
    except:
        break
for i in xrange(4):
    print l_ans[i],r_ans[i]

Submission status: Accepted

Solution code:
Res = [[0,0,0,0],[0,0,0,0]]
while True:
    try:
        l,r = map(float,input().split())
        if l < 0.2:
            Res[0][3] += 1
        elif l < 0.6:
            Res[0][2] += 1
        elif l < 1.1:
            Res[0][1] += 1
        else:
            Res[0][0] += 1

        if r < 0.2:
            Res[1][3] += 1
        elif r < 0.6:
            Res[1][2] += 1
        elif r < 1.1:
            Res[1][1] += 1
        else:
            Res[1][0] += 1
    except:
        for i in range(4):
            ans = str(Res[0][i]) + " " + str(Res[1][i])
            print(ans)
        break

Submission status: Accepted

Solution code:
ld, rd = [0, 0, 0, 0], [0, 0, 0, 0]
while True:
    try:
        l, r = map(float, input().split())
        if l < 0.2:
            ld[3] += 1
        elif l < 0.6:
            ld[2] += 1
        elif l < 1.1:
            ld[1] += 1
        else:
            ld[0] += 1

        if r < 0.2:
            rd[3] += 1
        elif r < 0.6:
            rd[2] += 1
        elif r < 1.1:
            rd[1] += 1
        else:
            rd[0] += 1

    except:
        break

for l, r in zip(ld, rd):
    print(l, r)

Submission status: Accepted

Solution code:
def f(a):
    if a>1.0:return 0
    elif a>0.5:return 1
    elif a>0.1:return 2
    else:return 3
b=[0]*8
while 1:
    try:l,r=map(float,input().split())
    except:break
    b[f(l)]+=1
    b[4+f(r)]+=1
for i in range(4):print(b[i],b[4+i])

Submission status: Accepted

Solution code:
lvl = [1.1, 0.6, 0.2, 0.0] 
rst = [[0]*4 for _ in range(2)]
eyes = []
while True:
    try:
        l,r = map(float,input().strip().split())
        eyes.append([l,r])
    except EOFError:
        break

for e in eyes:
    for lr in range(2):
        for l in range(len(lvl)):
            if e[lr]>=lvl[l]: 
                rst[lr][l] += 1
                break
        else:
            raise ValueError('Do not come here')

for lv in range(len(lvl)):
    print("%d %d" % (rst[0][lv],rst[1][lv]))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import os

A = [0, 0]
B = [0, 0]
C = [0, 0]
D = [0, 0]

for s in sys.stdin:
    l, r = map(float, s.split())

    if l >= 1.1:
        A[0] += 1
    elif l >= 0.6:
        B[0] += 1
    elif l >= 0.2:
        C[0] += 1
    else:
        D[0] += 1

    if r >= 1.1:
        A[1] += 1
    elif r >= 0.6:
        B[1] += 1
    elif r >= 0.2:
        C[1] += 1
    else:
        D[1] += 1

print(*A)
print(*B)
print(*C)
print(*D)

Submission status: Accepted

Solution code:
# Aizu Problem 00149: Eye Test
#
import sys, math, os, copy

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def get_judgement(x):
    if x >= 1.1:
        return "A"
    elif x >= .6:
        return "B"
    elif x >= .2:
        return "C"
    else:
        return "D"

    
count = {char: {"left": 0, "right": 0} for char in ['A', 'B', 'C', 'D']}
for line in sys.stdin:
    left, right = [float(_) for _ in line.split()]
    count[get_judgement(left)]["left"] += 1
    count[get_judgement(right)]["right"] += 1


for char in ['A', 'B', 'C', 'D']:
    print(count[char]["left"], count[char]["right"])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0149

"""
import sys
from sys import stdin
from collections import defaultdict
input = stdin.readline


def process_data(result, rank):
    if result >= 1.1:
        rank['A'] += 1
    elif result >= 0.6:
        rank['B'] += 1
    elif result >= 0.2:
        rank['C'] += 1
    else:
        rank['D'] += 1


def main(args):
    left_rank = defaultdict(int)
    right_rank = defaultdict(int)
    for line in sys.stdin:
        l, r = map(float, line.split())
        process_data(l, left_rank)
        process_data(r, right_rank)

    print('{} {}'.format(left_rank['A'], right_rank['A']))
    print('{} {}'.format(left_rank['B'], right_rank['B']))
    print('{} {}'.format(left_rank['C'], right_rank['C']))
    print('{} {}'.format(left_rank['D'], right_rank['D']))


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
import sys

BASE = [1.1, 0.6, 0.2, 0.0]
COUNT = len(BASE)


def eye_test(num):
    for index, parameter in enumerate(BASE):
        if parameter <= num:
            return index


left_counter = [0] * COUNT
right_counter = [0] * COUNT

for line in sys.stdin:
    left, right = [float(item) for item in line[:-1].split(" ")]
    left_eye, right_eye = eye_test(left), eye_test(right)
    left_counter[left_eye] += 1
    right_counter[right_eye] += 1

for item1, item2 in zip(left_counter, right_counter):
    print(item1, item2)

Submission status: Accepted

Solution code:
al,ar,bl,br,cl,cr,dl,dr=0,0,0,0,0,0,0,0
while True:
    try:
        le,re=map(float,input().split())
        if le<0.2:
            dl+=1
        if le>= 0.2 and le<0.6:
            cl += 1
        if le >= 0.6 and le<1.1:
            bl += 1
        if le >= 1.1:
            al += 1
        if re<0.2:
            dr+=1
        if re>= 0.2 and re<0.6:
            cr += 1
        if re >= 0.6 and re<1.1:
            br+= 1
        if re >= 1.1:
            ar += 1
    except:
        print(al,ar)
        print(bl,br)
        print(cl,cr)
        print(dl,dr)
        break

Submission status: Accepted

Solution code:
def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

def check(n):
    if n >= 11:
        return 0
    elif n >= 6:
        return 1
    elif n >= 2:
        return 2
    else:
        return 3

N = list(get_input())

cntL = [0,0,0,0]
cntR = [0,0,0,0]

for lll in range(len(N)):
    l,r = [int(float(i)*10) for i in N[lll].split()]
    cntL[check(l)] += 1
    cntR[check(r)] += 1

for i in range(4):
    print(cntL[i],cntR[i])

Submission status: Accepted

Solution code:
# AOJ 0149: Eye Test
# Python3 2018.6.17 bal4u

tbl = [[0 for j in range(4)] for i in range(2)]
while True:
	try: p = list(map(float, input().split()))
	except: break
	for i in range(2):
		if p[i] >= 1.1: tbl[i][0] += 1
		elif p[i] >= 0.6: tbl[i][1] += 1
		elif p[i] >= 0.2: tbl[i][2] += 1
		else: tbl[i][3] += 1
for i in range(4):
	print(tbl[0][i], tbl[1][i])

Submission status: Accepted

Solution code:
from collections import Counter

def check(f):
  if f >= 1.1:
    return "A"
  elif f >= 0.6:
    return "B"
  elif f >= 0.2:
    return "C"
  else:
    return "D"

dicl = Counter()
dicr = Counter()
while True:
  try:
    l, r = map(float, input().split())
    lx, rx = check(l), check(r)
    dicl[lx] += 1
    dicr[rx] += 1
  except EOFError:
    break
for alpha in ("A", "B", "C", "D"):
  print(dicl[alpha], dicr[alpha])

Submission status: Accepted

Solution code:
a1,a2,b1,b2,c1,c2,d1,d2 =0,0,0,0,0,0,0,0
while True:
  try:
    q,w = map(float,raw_input().split())
    if q >= 1.1: a1+=1
    if w >= 1.1: a2+=1
    if 1.1 > q >= 0.6: b1+=1
    if 1.1 > w >= 0.6: b2+=1
    if 0.6 > q >= 0.2: c1+=1
    if 0.6 > w >= 0.2: c2+=1
    if q < 0.2:d1+=1
    if w < 0.2:d2+=1
  except EOFError: break
if __name__ == '__main__':
  print a1,a2
  print b1,b2
  print c1,c2
  print d1,d2

Submission status: Accepted

Solution code:
result = {"left": [0] * 4, "right": [0] * 4}

def update(value, dest):
    if value >= 1.1: dest[0] += 1
    elif value >= 0.6: dest[1] += 1
    elif value >= 0.2: dest[2] += 1
    else: dest[3] += 1

while True:
    try:
        left, right = map(float, raw_input().split())
        update(left, result["left"])
        update(right, result["right"])
    except (EOFError):
        break

for i in range(4): print result["left"][i], result["right"][i]

Submission status: Accepted

Solution code:
al,ar,bl,br,cl,cr,dl,dr=0,0,0,0,0,0,0,0
while 1:
    try:
        l,r=map(float,raw_input().split())
        if l>=1.1:al+=1
        elif 0.6<=l<1.1:bl+=1
        elif 0.2<=l<0.6:cl+=1
        else:dl+=1

        if r>=1.1:ar+=1
        elif 0.6<=r<1.1:br+=1
        elif 0.2<=r<0.6:cr+=1
        else:dr+=1
    except EOFError:break
print "{} {}\n{} {}\n{} {}\n{} {}".format(al,ar,bl,br,cl,cr,dl,dr)

Submission status: Accepted

Solution code:
def Judge(i,A):
    if i<0.2:A[3]+=1
    elif i<0.6:A[2]+=1
    elif i<1.1:A[1]+=1
    else:A[0]+=1

L,R=[0]*4,[0]*4
while True:
    try:
        l,r=map(float,raw_input().split())
    except EOFError:
        break
    Judge(l,L)
    Judge(r,R)
for i in range(4):
    print L[i],R[i]

Submission status: Accepted

Solution code:
from bisect import bisect
D = [0.2,0.6,1.1]
L = [0,0,0,0]
R = [0,0,0,0]
while True:
    try:
        left,right = map(float,raw_input().split())
    except:
        break
    L[bisect(D,left)] += 1
    R[bisect(D,right)] += 1
for left,right in zip(L,R)[::-1]:
    print left,right

Submission status: Accepted

Solution code:
from bisect import bisect
D = [0.2,0.6,1.1]
L = [0]*4
R = [0]*4
while True:
    try:
        left,right = map(float,raw_input().split())
    except:
        break
    L[bisect(D,left)] += 1
    R[bisect(D,right)] += 1
for left,right in zip(L,R)[::-1]:
    print left,right

Submission status: Accepted

Solution code:
left = [0]*4; right = [0]*4;
while 1:
    try:
        l,r = map(float, raw_input().split())
        if l>0.7: l-=0.1
        if r>0.7: r-=0.1
        left[min(15,2+int(10*l))/4]+=1
        right[min(15,2+int(10*r))/4]+=1
    except EOFError:
        break
for i in xrange(3,-1,-1):
    print left[i],right[i]

Submission status: Accepted

Solution code:
rank = [[0,0] for i in range(4)]
while True:
    try:
        eye = map(float, raw_input().split())
        for i in range(2):
            if   eye[i] >= 1.1: rank[0][i] += 1
            elif eye[i] >= 0.6: rank[1][i] += 1
            elif eye[i] >= 0.2: rank[2][i] += 1
            else:                   rank[3][i] += 1
    except:
        break
for i in range(4):
    print " ".join(map(str, rank[i]))

Submission status: Accepted

Solution code:
c = [1.1,0.6,0.2,0.0]
r = [[0,0] for i in range(4)]
while True:
    try:
        e = map(float, raw_input().split())
        for i in range(2):
            for j in range(4):
                if e[i] >= c[j]:
                	r[j][i] += 1
                	break
    except:
        break
for i in range(4):
	print r[i][0],r[i][1]

Submission status: Accepted

Solution code:
c = [1.1,0.6,0.2,0.0]
r = [0,0,0,0,0,0,0,0]
while 1:
    try:
        e = map(float, raw_input().split())
        for i in range(2):
            for j in range(4):
                if e[i] >= c[j]:
                	r[i+2*j] += 1
                	break
    except:
        break
for i in range(0,8,2):
	print r[i],r[i+1]

Submission status: Accepted

Solution code:
c = [1.1,0.6,0.2,0.0]
r = [0 for i in range(8)]
while 1:
    try:
        e = map(float, raw_input().split())
        for i in range(2):
            for j in range(4):
                if e[i] >= c[j]:
                	r[i+2*j] += 1
                	break
    except:
        break
for i in range(0,8,2):
	print r[i],r[i+1]

Submission status: Accepted

Solution code:
from bisect import bisect
ref = [0.2,0.6,1.1]
l,r = [0]*4,[0]*4
while 1:
    try:
        le,re = map(float, raw_input().split())
        l[bisect(ref,le)] += 1
        r[bisect(ref,re)] += 1
    except:
        break
for i in range(1,5):
	print l[-i],r[-i]

Submission status: Accepted

Solution code:
from bisect import bisect
ref = [0.2,0.6,1.1]
l,r = [0]*4,[0]*4
while 1:
    try:
        le,re = map(float, raw_input().split())
    except:
        break
    l[bisect(ref,le)] += 1
    r[bisect(ref,re)] += 1
for i in range(1,5):
	print l[-i],r[-i]

Submission status: Accepted

Solution code:
import sys
LA = RA = 0
LB = RB = 0
LC = RC = 0
LD = RD = 0

for i in sys.stdin:
    l,r = map(float,i.split())
    if l >= 1.1:
        LA += 1
    elif 0.6 <= l <1.1:
        LB += 1
    elif 0.2 <= l < 0.6:
        LC += 1
    else:
        LD += 1

    if r >= 1.1:
        RA += 1
    elif 0.6 <= r <1.1:
        RB += 1
    elif 0.2 <= r < 0.6:
        RC += 1
    else:
        RD += 1

print(LA,RA)
print(LB,RB)
print(LC,RC)
print(LD,RD)

Submission status: Accepted

Solution code:
r_A = 0
r_B = 0
r_C = 0
r_D = 0
l_A = 0
l_B = 0
l_C = 0
l_D = 0

while True :
    try :
        l, r = map(float, input().split())
    except EOFError :
        break
    
    if l >= 1.1 :
        l_A += 1
    elif l >= 0.6 :
        l_B += 1
    elif l >= 0.2 :
        l_C += 1
    else :
        l_D += 1
    if r >= 1.1 :
        r_A += 1
    elif r >= 0.6 :
        r_B += 1
    elif r >= 0.2 :
        r_C += 1
    else :
        r_D += 1

print(l_A, r_A)
print(l_B, r_B)
print(l_C, r_C)
print(l_D, r_D)

Submission status: Accepted

Solution code:
import sys
import math
al=0
bl=0
cl=0
dl=0
ar=0
br=0
cr=0
dr=0
try:
    while True:
        l,r=map(float,input().split())
        if(l>=1.1):
            al=al+1
        elif(l>=0.6 and l<1.1):
            bl=bl+1
        elif(l>=0.2 and l<0.6):
            cl=cl+1
        else:
            dl=dl+1
        if(r>=1.1):
            ar=ar+1
        elif(r>=0.6 and r<1.1):
            br=br+1
        elif(r>=0.2 and r<0.6):
            cr=cr+1
        else:
            dr=dr+1
except EOFError:
    pass
print(str(al)+' '+str(ar))
print(str(bl)+' '+str(br))
print(str(cl)+' '+str(cr))
print(str(dl)+' '+str(dr))

Submission status: Accepted

Solution code:
lr = [0 for i in range(8)]
while True:
    try:
        a,b = map(float,input().split())
    except:
        break
    if a >= 1.1:
        lr[0] += 1
    elif a >= 0.6:
        lr[2] += 1
    elif a >= 0.2:
        lr[4] += 1
    else:
        lr[6] += 1
    if b >= 1.1:
        lr[1] += 1
    elif b >= 0.6:
        lr[3] += 1
    elif b >= 0.2:
        lr[5] += 1
    else:
        lr[7] += 1
print(lr[0],lr[1])
print(lr[2],lr[3])
print(lr[4],lr[5])
print(lr[6],lr[7])

Submission status: Accepted

Solution code:

L = [[0 for x in range(4)] for y in range(2)]

while True:
    try:
        E = [ float(x) for x in input().split()]
        for i in range(2):
            if E[i] >= 1.1:
                L[i][0] += 1
            elif E[i] >= 0.6:
                L[i][1] += 1
            elif E[i] >= 0.2:
                L[i][2] += 1
            else:
                L[i][3] += 1
            
    except EOFError:
        break

for i in range(4):
    print(L[0][i], L[1][i])

Submission status: Accepted

Solution code:
li, ri = [0, 0, 0, 0], [0, 0, 0, 0]
while True:
    try:
        l, r = map(float, input().split())
    except:
        break
    
    if l < 0.2:
        li[3] += 1
    elif l < 0.6:
        li[2] += 1
    elif l < 1.1:
        li[1] += 1
    else:
        li[0] += 1
 
    if r < 0.2:
        ri[3] += 1
    elif r < 0.6:
        ri[2] += 1
    elif r < 1.1:
        ri[1] += 1
    else:
        ri[0] += 1

for l, r in zip(li, ri):
    print(l, r)

Submission status: Accepted

Solution code:
E=[[0 for j in range(4)]for i in range(2)]
while True:
  try:
    p =list(map(float,input().split()))
  except:
    break
  for i in range(2):
    if p[i]>=1.1:
      E[i][0]+=1
    elif p[i]>=0.6:
      E[i][1]+=1
    elif p[i]>=0.2:
      E[i][2]+=1
    else:
      E[i][3]+=1
      
for i in range(4):
  print(E[0][i], E[1][i])

Submission status: Accepted

Solution code:
tbl = [[0 for j in range(4)] for i in range(2)]
while True:
    try: p = list(map(float, input().split()))
    except: break
    for i in range(2):
        if p[i] >= 1.1: tbl[i][0] += 1
        elif p[i] >= 0.6: tbl[i][1] += 1
        elif p[i] >= 0.2: tbl[i][2] += 1
        else: tbl[i][3] += 1
for i in range(4):
    print(tbl[0][i], tbl[1][i])

Submission status: Accepted

Solution code:
def f(a):
    if a>1.0:return 0
    elif a>0.5:return 1
    elif a>0.1:return 2
    else:return 3
b=[0]*8
while 1:
    try:l,r=map(float,input().split())
    except:break
    b[f(l)]+=1
    b[4+f(r)]+=1
for i in range(4):print(b[i],b[4+i])

Submission status: Accepted

Solution code:
def check(n, array):
    if 1.1 <= n:
        array[0] += 1
    elif 0.6 <= n < 1.1:
        array[1] += 1
    elif 0.2 <= n < 0.6:
        array[2] += 1
    else:
        array[3] += 1


left = [0] * 4
right = [0] * 4
while 1:
    try:
        l, r = map(float, input().split())
    except:
        break

    check(l, left)
    check(r, right)

for l, r in zip(left, right):
    print(l, r)

Submission status: Accepted

Solution code:
la, lb, lc, ld = 0, 0, 0, 0
ra, rb, rc, rd = 0, 0, 0, 0

while True:
    try: n = input()
    except: break

    l, r = map(float, n.split())
    
    if 1.1 <= l:
        la += 1
    elif 0.6 <= l < 1.1:
        lb += 1
    elif 0.2 <= l < 0.6:
        lc += 1
    elif l < 0.2:
        ld += 1
    
    if 1.1 <= r:
        ra += 1
    elif 0.6 <= r < 1.1:
        rb += 1
    elif 0.2 <= r < 0.6:
        rc += 1
    elif r < 0.2:
        rd += 1

print(la, ra)
print(lb, rb)
print(lc, rc)
print(ld, rd)

Submission status: Accepted

Solution code:
eyes = [[0 for i in range(2)] for j in range(4)]
while True:
    try:
        a = list(map(float, input().split()))
    except:
        break
    for i in range(2):
        if a[i] >= 1.1: eyes[0][i]+=1
        elif a[i] >= 0.6: eyes[1][i]+=1
        elif a[i] >= 0.2: eyes[2][i]+=1
        else: eyes[3][i]+=1
for i in range(4):
    print(*eyes[i])

Submission status: Runtime Error

Solution code:
def hantei(l):
    if l >= 1.1:
        return 'A'
    elif 0.6 <= l < 1.1:
        return 'B'
    elif 0.2 <= l < 0.6:
        return 'C'
    elif 0.2 < l:
        return 'D'

ldic = {'A':0, 'B':0, 'C':0, 'D':0}
rdic = {'A':0, 'B':0, 'C':0, 'D':0}
ls = []
while True:
    try:
        l,r = map(float,raw_input().split())
        ls.append((l,r))
    except EOFError:
        break
for l,r in ls:
    ldic[hantei(l)] += 1
    rdic[hantei(r)] += 1
    
for L,R in zip(sorted(ldic),sorted(rdic)):
    print L,R

Submission status: Runtime Error

Solution code:
def hantei(l):
    if l >= 1.1:
        return 'A'
    elif 0.6 <= l < 1.1:
        return 'B'
    elif 0.2 <= l < 0.6:
        return 'C'
    elif 0.2 < l:
        return 'D'

ldic = {'A':0, 'B':0, 'C':0, 'D':0}
rdic = {'A':0, 'B':0, 'C':0, 'D':0}
ls = []
while True:
    try:
        l,r = map(float,raw_input().split())
        ls.append((l,r))
    except EOFError:
        break
        
for i,j in ls:
    ldic[hantei(i)] += 1
    rdic[hantei(j)] += 1
    
for L,R in zip(sorted(ldic),sorted(rdic)):
    print L,R

Submission status: Runtime Error

Solution code:
ld, rd = [0, 0, 0, 0]. [0, 0, 0, 0]
while True:
    try:
        l, r = map(float, input().split())
        if l < 0.2:
            ld[3] += 1
        elif l < 0.6:
            ld[2] += 1
        elif l < 1.1:
            ld[1] += 1
        else:
            ld[0] += 1

        if r < 0.2:
            rd[3] += 1
        elif r < 0.6:
            rd[2] += 1
        elif r < 1.1:
            rd[1] += 1
        else:
            rd[0] += 1

    except:
        break

for l, r in zip(ld, rd):
    print(l, r)

Submission status: Runtime Error

Solution code:
ref = [1.1,0.6,0.2,0.0]
rank = [[0,0] for i in range(4)]
while True:
    try:
        eye = map(float, raw_input().split())
        for i in range(2): 
            for j in range(4):
                if eye[i] >= ref[j]: rank[j][i] += 1
                break
    except:
        break

    print " ".join(map(str, rank[i])) for i in range(4)

Submission status: WA: Presentation Error

Solution code:
lvl = [1.1, 0.6, 0.2, 0.0] 
rst = [[0]*4 for _ in range(2)]
eyes = []
while True:
    try:
        l,r = map(float,input().strip().split())
        eyes.append([l,r])
    except EOFError:
        break

for e in eyes:
    for lr in range(2):
        for l in range(len(lvl)):
            if e[lr]>=lvl[l]: 
                rst[lr][l] += 1
                break
        else:
            raise ValueError('Do not come here')

for lv in range(len(lvl)):
    print(rst[0][lv]," ",rst[1][lv])