Problem:


未提出者は誰だ

問題

JOI大学のM教授はプログラミングの授業を担当している．クラスには30人の受講生がいて各受講生には1番から30番までの出席番号がふられている．この授業の課題を28人の学生が提出した．提出した28人の出席番号から提出していない2人の出席番号を求めるプログラムを作成せよ．

入力

入力は28行あり，各行には提出者の出席番号（1以上30以下）が1つずつ書かれている．入力される出席番号に重複はないが，どのような順に入力されるかはわからない．

出力

出力は2行からなる． 1行目に2人の未提出者の出席番号のうち小さいほうを， 2行目に大きいほうを出力せよ．

入出力例

入力例 1

3
1
4
5
7
9
6
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

出力例 1

2
8

入力例 2

9
30
6
12
10
20
21
11
7
5
28
4
18
29
17
19
27
13
16
26
14
23
22
15
3
1
24
25

出力例 2

2
8

上記問題文と自動審判に使われるデータは、情報オリンピック日本委員会が作成し公開している問題文と採点用テストデータです。



Sample input:
3
1
4
5
7
9
6
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30


Sample output:
2
8

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
g=int(input())
h=int(input())
i=int(input())
j=int(input())
k=int(input())
l=int(input())
m=int(input())
n=int(input())
o=int(input())
p=int(input())
q=int(input())
r=int(input())
s=int(input())
t=int(input())
u=int(input())
v=int(input())
w=int(input())
x=int(input())
y=int(input())
z=int(input())
wa=int(input())
ke=int(input())

cc=list(range(1,31))
dd=[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,wa,ke]

ee=list(set(cc)-set(dd))
ee.sort()
print(ee[0])
print(ee[1])

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
l=[]
for x in range(28):
    a=int(input())
    l.append(a)

result=list(set(range(1,31))-set(l))
        
result.sort()
            
print(result[0])
print(result[1])

Submission status: Accepted

Solution code:
a = []
b=list(range(1,31))
for i in range (28):
    n = int(input())
    a.append(n)
c=list(set(b)-set(a))
c.sort()
print(c[0])
print(c[1])

Submission status: Accepted

Solution code:
a= [int(input()) for i in range(28)]

    
for i in range(1,31):
    if i in a:
        pass
    else:
        print(i)

Submission status: Accepted

Solution code:
n=[int(input()) for i in range(28)]
for j in range(1,31):
    if j not in n:
        print(j)

Submission status: Accepted

Solution code:
num=[]
for i in range(28):
    num.append(int(input()))
for i in range(1,31):
    if i not in num:
        print(i)

Submission status: Accepted

Solution code:
lst=[]
lst2=list(range(1,31))
for i in range(28):
    n=int(input())
    lst.append(n)
lst3=list(set(lst2) - set(lst))
lst3.sort()
for i in range(2):
    print(lst3[i])

Submission status: Accepted

Solution code:
a=[int(input()) for i in range(28)]
a.sort()
j=0
for i in range(29):
    if a[j]==i+1:
        j+=1
    else :
        print(i+1)

if a[27]!=30:
    print(30)

Submission status: Accepted

Solution code:
# coding: utf-8
# 46

A = [int(input()) for i in range(28)]

A.sort()
#print(A)
B = list()

for i in range(1,31):
        B.append(i)
#print(B)       

a = set(A)^set(B)
K = list(a)
print(K[0])
print(K[1])

Submission status: Accepted

Solution code:

n = list(range(1,31))
m = [int(input()) for i in range(28)]

result = list(set(n)-set(m))

print(min(result))
print(max(result))

Submission status: Accepted

Solution code:
i=0
x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
k2=0
while i<28 :
    x[i]=int(input())
    i=1+i
while k2<27 :
    k=0
    while k<27 :
        if x[k]>x[k+1] : 
            ex=x[k]
            x[k]=x[k+1]
            x[k+1]=ex
        k=k+1
    k2=k2+1
if x[0]==2 : print("1")
elif x[0]==3 : 
    print("1")
    print("2")
if x[27]==29 : print("30")
elif x[27]==28 : 
    print("29")
    print("30")
i=0
while i<27 :
    if x[i+1]-x[i]==2 :
        a=x[i]+1
        print(a)
    elif x[i+1]-x[i]==3 : 
        a=x[i]+1
        b=a+1
        print(a)
        print(b)
    i=1+i

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

try:
   l = []
   for i in range(28):
      l.append(int(input()))

   for i in range(1, 31):
      if i not in l:
         print(i)

except EOFError:
   pass

#for i in range(1, 31):
   #if l[i] == 0:
      #print(i)

Submission status: Accepted

Solution code:
a=[]

for i in range(28):
    a.append(int(input()))


for i in range(1,31):
    if i not in a:
        print(i)

Submission status: Accepted

Solution code:
a = list(range(1, 31))
i = 1
while i <= 28:
    n = int(input())
    a.remove(n)
    i += 1

print(a[0])
print(a[1])

Submission status: Accepted

Solution code:
a=[0]*30
b=[0]*28
x=1
for i in range(30):
    a[i] = x
    x += 1
    
for i in range(28):
    b[i] = int(input())
    del a[a.index(b[i])]

print(a[0])
print(a[1])

Submission status: Accepted

Solution code:
n=list(range(31)[1:])
for i in range(28):
    n.remove(int(input()))
print(n[0])
print(n[1])

Submission status: Accepted

Solution code:
L = [int(input()) for i in range(28)]
l = sorted(L)
s = list(range(1,31))
t = list(set(l) ^ set(s))
print(t[0])
print(t[1])

Submission status: Accepted

Solution code:
x=[]


for i in range (28):
    n=int(input())
    x.append(n)
x1=sorted(x)

j=0
for j in range(30):
    j+=1
    if j in x:
        pass
    else:
        print(j)

Submission status: Accepted

Solution code:
x=[]
for i in range(28):
    a=int(input())
    x.append(a)
x1=sorted(x)
J=0
for j in range(30):
    j+=1
    if j in x:
        pass
    else:
        print(j)

Submission status: Accepted

Solution code:
a=[int(input()) for i in range(28)]
for i in range(1,31):
    if not(i in a):
        print(i)

Submission status: Accepted

Solution code:
#空リスト作成
num_list = []
line = []
#入力値を全てリストに格納
for num in range(28):
    num_list.append(int(input()))
#リストにない関数をべつのリストに追加する
for num1 in range(1,31):
    if num1 in num_list:
        continue
    else:
        line.append(num1)
#出力
print(min(line))
print(max(line))

Submission status: Accepted

Solution code:
s=[]
for i in range(1,29):
    x=int(input())
    s.append(x)
    
for i in range(1,31):
    if i in s:
        pass
    else:
        print(i)

Submission status: Accepted

Solution code:
L=list(range(1,31))
for i in range(28):
  del L[L.index(int(input()))]
print(L[0])
print(L[1])

Submission status: Accepted

Solution code:
x = [int(input()) for _ in range(28)]
print(*[i for i in range(1, 31) if i not in x], sep="\n")

Submission status: Accepted

Solution code:
l = [ i for i in range(1,31) ]
for i in range(28):
    n = int(input())
    l[n-1] = 0

print(*sorted(list(filter(lambda x: x!=0, l))), sep='\n')

Submission status: Accepted

Solution code:
s = set([int(input()) for _ in range(28)])
t = set([i+1 for i in range(30)])
print(min(list(t-s)))
print(max(list(t-s)))

Submission status: Accepted

Solution code:
joi = []
for i in range(30):
    joi.append(i+1)
for j in range(28):
    num = int(input())
    joi.remove(num)
print(joi[0])
print(joi[1])

Submission status: Accepted

Solution code:
S={i for i in range(1,31)}
O=[int(input()) for i in range(28)]
O=set(O)
I=sorted(list(S-O))
I=[print(I[i]) for i in range(len(I))]

Submission status: Accepted

Solution code:

L = [False] * 31

while True:
    try:
        s = int(input())
    except:
        break
    L[s] = True

for i in range(1,31):
    if not L[i]:
        print(i)

Submission status: Accepted

Solution code:
def main():
    check = [False] * 30

    for i in range(28):
        no = int(input())
        check[no - 1] = True

    for i in range(30):
        if not check[i]:
            print(i + 1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
submit=[False for i in range(31)]

for i in range(28):
    submit[int(input())] = True

for i in range(1,31):
    if not submit[i]:
        print(i)

Submission status: Accepted

Solution code:
list=[0 for n in range(30)]
for nn in range(28):
	a=int(input())
	list[a-1]=1
for nnn in range(30):
	if list[nnn]==0:
		print(nnn+1)

Submission status: Accepted

Solution code:
list1=[int(input()) for i in range(28)]
for i in range(1,31):
    if not(i in list1):
        print(i)

Submission status: Accepted

Solution code:
num = []
for _ in range(28):
    num.append(int(input()))

for i in range(1, 31):
    if i not in num:
        print(i)

Submission status: Accepted

Solution code:
aset = set(int(input().strip()) for _ in range(28))
bset = set(range(1,31))
for i in sorted(bset-aset):
    print(i)

Submission status: Accepted

Solution code:
list = []
for i in range(1,31):
	list.append(i)
for j in range(28):
	list.remove(input())
list.sort()
print list[0]
print list[1]

Submission status: Runtime Error

Solution code:
a = [False for i in range(31)]

for i in range(30):
    x = int(input())
    a[x] = True
for i in range(1, 30):
    if a[i] == False:
        print(i)

Submission status: Runtime Error

Solution code:
students = list(range(30))
[students.remove(int(input())) for _ in range(28)] 
[print(student) for student in students]

Submission status: Runtime Error

Solution code:
c=0
for i,j in enumerate(sorted([input() for i in range(30)])):
    c+=1
    if c!=j:print c ;c+=1

Submission status: Runtime Error

Solution code:
data = [x + 1 for x in xrange(30)]
# print(data)

for i in xrange(30):
    a = int(raw_input())

    data.remove(a)
#     print(data)

for i in data:
    print(i)

Submission status: Runtime Error

Solution code:
ref = set[i for i in range(1,31)]
for i in range(28):
    ls.append(i)
print "".join(map(str, sorted(list(ref-set(ls)))))

Submission status: Runtime Error

Solution code:
ref = [i for i in range(1,31)]
for i in range(28):
    ref.pop(int(raw_input())-1)
for i in ref:
    print i