Problem:


Score: 100 points

Problem Statement

A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.

You will be given three integers A, B, and C. If this triple is poor, print Yes; otherwise, print No.

Constraints

A, B, and C are all integers between 1 and 9 (inclusive).

Input

Input is given from Standard Input in the following format:

A B C

Output

If the given triple is poor, print Yes; otherwise, print No.

Sample Input 1

5 7 5

Sample Output 1

Yes

A and C are equal, but B is different from those two numbers, so this triple is poor.

Sample Input 2

4 4 4

Sample Output 2

No

A, B, and C are all equal, so this triple is not poor.

Sample Input 3

4 9 6

Sample Output 3

No

Sample Input 4

3 3 4

Sample Output 4

Yes



Sample input:
5 7 5


Sample output:
Yes

Submission status: Runtime Error

Solution code:
if len(set(list(map(int, input())))) == 2:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
A=list(map(int,input(),split()))
a=A[0]-A[1]
b=A[2]-A[1]
if a==0 or b==0 or a==b or a+b==0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
A=list(map(int,input(),split()))
A=sorted(A)
if A[1]==A[0] or A[1]==A[2]:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
    x = list(map(int,input().split()))
    if len(set(x))== 2:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
from collections import Counter


def words_sort_ordered(words_list):
    word_cnt = Counter()
    for word in words_list:
        word_cnt[word] += 1

    word_written_max_time = 0
    for each_word_ct in word_cnt.values():
        if each_word_ct > word_written_max_time:
            word_written_max_time = each_word_ct

    answer_words_list = []
    for word, number in dict(word_cnt).items():
        if number == word_written_max_time:
            answer_words_list.append(word)

    return sorted(answer_words_list)


if __name__ == '__main__':
    words_num = int(input())
    words_list = [input() for i in range(words_num)]
    for w in words_sort_ordered(words_list):
        print(w)

Submission status: Runtime Error

Solution code:
import sys, os, math

A = int(input())
B = int(input())
C = int(input())

ispoor = 0

if A == B and B != C:
	ispoor = 1
if A == C and B != C:
	ispoor = 1
if B == C and A != C:
	ispoor = 1
if ispoor:
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
if (A == B and B != C) or (A == C and B != C) or (B == C and A != C):
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
#!usr/bin/python3

import sys, os, math

A = int(input())
B = int(input())
C = int(input())

if (A == B and B != C) or (A == C and B != C) or (B == C and A != C):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
a, b, c = (int, raw_input().split())
 
if a == b or a == c:
  print ('Yes')
elif b == c:
  print ('Yes')
else:
  print ('No')

Submission status: Runtime Error

Solution code:
a, b, c = (int, input().split())

if a == b or a == c:
  print ('Yes')
elif b == c:
  print ('Yes')
else:
  print ('No')

Submission status: Runtime Error

Solution code:
a, b, c= map(int, input().split())
kawaiso = 0 
if a==b && a!=c:
    kawaiso = 1

else if b==c && b!=a :
    kawaiso = 1

else if c==a && c!=b :
    kawaiso = 1
else :
    kawaiso = 0

if kawaiso == 1 :
    print ('yes')

else :
    print('No')

Submission status: Runtime Error

Solution code:
a, b, c= map(int, input().split())
kawaiso = 0 
if a==b && a!=c:
    kawaiso = 1

if b==c && b!=a :
    kawaiso = 1

if c==a && c!=b :
    kawaiso = 1
else :
    kawaiso = 0
    
if kawaiso == 1 :
    print ('yes')

else :
    print('No')

Submission status: Runtime Error

Solution code:
a, b, c= map(int, input().split())
kawaiso = 0 
if a==b && a!=c:
    kawaiso = 1

if b==c && b!=a :
    kawaiso = 1

if c==a && c!=b :
    kawaiso = 1

if kawaiso == 1 :
    print ('yes')

else :
    print('No')

Submission status: Runtime Error

Solution code:
a, b, c= map(int, input().split())
kawaiso = 0 
if a==b && a!=c:
    kawaiso = 1

if b==c && b!=a :
    kawaiso = 1
]
if c==a && c!=b :
    kawaiso = 1

if kawaiso == 1 :
    print ('yes')

else :
    print('No')

Submission status: Runtime Error

Solution code:
a, b, c= map(int, input().split())
kawaiso = 0 
if a==b && a!=c [
    kawaiso = 1
]
if b==c && b!=a [
    kawaiso = 1
]
if c==a && c!=b [
    kawaiso = 1
]
if kawaiso == 1 [
    print (yes)
]
else [
    print(No)
]

Submission status: Runtime Error

Solution code:
import bisect
 
 
n, k = map(lambda x: int(x), input().split())
a = list(map(lambda x: int(x), input().split()))
 
a.sort()
pos = bisect.bisect(a, 0)
 
def judge(cur):
    global n, k, a
    cnt, j = 0, 1
    for i in range(pos):
        while(j < len(a) and (i == j or a[i] * a[j] > cur)): j += 1
        if(j >= len(a)): break
        cnt += (len(a) - j)
 
    j = len(a) - 1
    for i in range(pos, len(a)):
        while(j > i and (i == j or a[i] * a[j] > cur)): j -= 1
        if(i >= j): break
        cnt += (j-i)
 
    if(cnt >= k): return True
    else: return False
 
 
l, r = int(-1e18), int(1e18)
while(l < r):
    m = (l+r)>>1
    if(judge(m)): r = m
    else: l = m + 1

if(judge(r) == False): r -= 1
print(r)

Submission status: Runtime Error

Solution code:
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv,
    std.functional, std.math, std.numeric, std.range, std.stdio, std.string,
    std.random, std.typecons, std.container;

ulong MAX = 1_000_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Pair = Tuple!(long, "damage", long, "cost");
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);

void main()
{
    long a, b, c;
    scan(a, b, c);
    if ((a == b && a != c) || (a == c && a != b) || (b == c && a != b))
    {
        writeln("Yes");
    }
    else
    {
        writeln("No");
    }
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
ans = "Yes" if len(set(a,b,c)) == 2 else "No"
print(ans)

Submission status: Runtime Error

Solution code:
a,b,c=input().split()
print("Yes" if sum(a==b,b==c,c==a)==1 else "No")

Submission status: Runtime Error

Solution code:
n=int(input())
S=[]
for i in range(n):
    S.append(input())

from collections import defaultdict
d = defaultdict(lambda:0)

for k in S:
    d[str(k)]+=1

ansn=max(d.values())
ans=[]
for i in set(S):
    if d[i]==ansn:
        ans.append(i)

ans=sorted(ans)
for i in range(len(ans)):
    print(ans[i])

Submission status: Runtime Error

Solution code:
import collections

n = int(input())
s = [input() for i in range(n)]

c = collections.Counter(s).most_common()
ans = [k for k, v in c if c[0][1] == v]
ans.sort()

for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
import sys
 
if __name__ == '__main__':
  args = sys.argv
  ret="No"
  
  if (args[1] == args[2] or args[2] == args[3] or args[1] == args[3]):
    ret="Yes"
    
  print(ret)

Submission status: Runtime Error

Solution code:
import collections

def main():
    n =int( input())
    sn = []

    for _ in range(n):
        inWord = str(input())
        addFlag = True
        for s in sn:
            if s["word"] == inWord and len(sn) !=0:
                s["count"]+=1
                addFlag = False
                break
        if addFlag ==True:
            sn.append( {"word":inWord,"count":1})
    
    sn.sort(reverse=True,key=lambda x:x['count'])
    
    most = int(sn[0]["count"])
    mostWords=[]
    for elm in sn:
        if elm["count"] == most:
            mostWords.append(elm["word"])
        else:
            break

    mostWords.sort()

    for elm in mostWords:
        print(elm)
    return
main()

Submission status: Runtime Error

Solution code:
import sys
 
if __name__ == '__main__':
  args = sys.argv
  ret="No"
  
  if (args[1] == args[2] | args[2] == args[3] | args[1] == args[3]):
    ret="Yes"
    
  print(ret)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
if(a==b&&b==c):
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
a,b,c=sorted(map(int,input().split())
if(a!=b):
             print("Yes")
else:
             print("No")

Submission status: Runtime Error

Solution code:
import sys

if __name__ == '__main__':
  args = sys.argv
  ret="No"
  
  if (args[1] == args[2] || args[2] == args[3] || args[1] == args[3]):
    ret="Yes"
    
  print(ret)

Submission status: Runtime Error

Solution code:
import numpy as np

N, K = input().split()
A = input().split()
N = int(N)
K = int(K)
A = list(map(int, A))

B = []
for i in range(N):
    for j in range(N):
        if i>j:
            B.append(np.dot(A[i], A[j]))

B.sort()
print(B[K-1])

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())

if a=b and b=c :
    print('No')
elif a=b or a=c or b=c:
    print("Yes")
else:
    print('No')

Submission status: Runtime Error

Solution code:
from bisect import bisect_right as br
from bisect import bisect_left as bl
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
l,r=10**18,-10**18-1
while l-r>1:
    t=(l+r)//2
    p=0
    for i in a:
        if i<0:
            p+=n-bl(a,t/i)
        elif i==0:
            if t>=0:
                p+=n
        else:
            p+=br(a,t/i)
        if i**2<=t:
            p-=1
    p//=2
    if p>=k:
        l=t
    else:
        r=t
g=-float("INF")
for i in range(n):
    if a[i]<0:
        c=bl(a,l/a[i])
        if c==i:
            c+=1
        if c<n:
            g=max(g,a[c]*a[i])
    elif a[i]==0:
        g=max(g,0)
    else:
        c=br(a,l/a[i])-1
        if c==i:
            c-=1
        if c>0:
            g=max(g,a[c]*a[i])
print(g)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())

if a=b and b=c :
    print("Yes")
else:
    print('No')

Submission status: Runtime Error

Solution code:
import collections

N = int(input())
data = [input() for i in range(N)]

dicdata = collections.Counter(data)

m = max(dicdata.values())

newdata = [k for k, v in dicdata.items() if v == m]

newdata.sort()

[print(i) for i in newdata]

Submission status: Runtime Error

Solution code:
num=list(map(int,input().split()))
print('Yes' if len(num) == len(set(num) + 1) else 'No')

Submission status: Runtime Error

Solution code:
S = list(map(int,input().split())
print("Yes" if len(set(S))==2 else "No")

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
A = list(map(int,input().split()))
ans = []
for i,num in enumerate(A):
    for j in range(i+1,N):
        ans.append(num * A[j])
ans.sort()
print(ans[K-1])

Submission status: Runtime Error

Solution code:
N = int(input())
S = list()

for _ in range(N):
    S.append(input())
S_set = set(S)
S_dict = dict()
for s in S_set:
    S_dict[s] = 0

for val in S:
    S_dict[val] += 1
max_num = max(S_dict.values())
ans = list()
for k, v in S_dict.items():
    if v == max_num:
        ans.append(k)
ans = sorted(ans)
for res in ans:
    print(res)

Submission status: Runtime Error

Solution code:
import itertools

n,k=map(int,input().split())
s=map(int,input().split())

t=[]

for a,b in itertools.combinations(s,2):
  t.append(a*b)

t.sort()

print(t[k-1])

Submission status: Runtime Error

Solution code:
import sys
import math
import itertools as it
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
n = i()
s = [input() for _ in range(n)]
s.sort()
ss = list(set(s))
ss.sort()
a = [0]*len(ss)
i = 0
j = 0
while n-1 > i:
    if s[i] == s[i+1]:
        a[j] += 1
        i += 1
    else:
        i += 1
        j += 1
m = max(a)
for k in range(len(a)):
    if m == a[k]:
        print(ss[k])

Submission status: Runtime Error

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

import os
import datetime

def main():
    a, b = map(int, input().split())
    val = list(map(lambda x: int(x), input().split()))

    result_dict = []

    for i in range(len(val)):
        for j in range(i+1, len(val)):
            result_dict.append(val[i] * val[j])

    min_list = sorted(result_dict)
    print(min_list[b-1])

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
*l = map(int, input().split())
if len(set(l)) == 2:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
import collections
a = int(input())
l = []
for i in range(a):
    l.append(input())
counted = collections.Counter(l)

# 最頻値を求める
m = max(counted.values())

# 頻出数の文字を集める
chars = [key for key, value in counted.items()
             if value == m]

for i in chars:
    print(i)

Submission status: Runtime Error

Solution code:
n,k=(int(x) for x in input().split())
list1 = list(map(int, input().split()))
list1.sort()
list2 = [n-1]*n
list3=[]
for j in range(n):
	list3.append(list1[j]*list1[list2[j]])
for j in range(k):
	max1=list3.index(max(list3))
	list2[max1]-=1
	list3[max1]=list1[max1]*list2[max1]
print(list3[max1])

Submission status: Runtime Error

Solution code:
import sys
N, K = list(map(int, input().split()))
A_N = list(map(int, input().split()))
B = []
b = 0
for i in range(N-1):
    for j in range(N-1):
        if i <= j:
            b = A_N[i] * A_N[j+1]
            B.append(b)
            b = 0
B = sorted(B)
# print(B)
print(B[K-1])

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
for i in range(n):
  if (a[i]%2==0):
    if(a[i]/3!=0 or a[i]/5!=0):
      print("DENIED")
      	exit()
print("APPROVED")

Submission status: Runtime Error

Solution code:
def main():
    n =int( input())
    sn=[]
    
    for i in range(n):
        inWord = str(input())
        addFlag = True
        for s in sn:
            if s["word"] == inWord and len(sn) !=0:
                s["count"]+=1
                addFlag = False
                break
        if addFlag ==True:
            sn.append( {"word":inWord,"count":1})
    
    a= sorted(sn, reverse=True,key=lambda x:x['count'])

    most = a[0]["count"]
    mostWords=[]
    for elm in a:
        if elm["count"] == most:
            mostWords.append(elm["word"])
    mostWords.sort()
    for elm in mostWords:
        print(elm)
    return
main()

Submission status: Runtime Error

Solution code:
n = int(input())
d = {}
for i in range(n):
  s = input()
  if s not in d:d[s] = 0
  d[s] += 1
max_cnt = sorted(d.items(), key=lambda tp:tp[1])[-1][1]
a1 = filter(lambda tp:tp[1] == max_cnt, d.items())
a2 = map(lambda tp:tp[0], a1)
for s in sorted(a2):
  print(s)

Submission status: Runtime Error

Solution code:
import itertools
N, K = map(int, input().split())
pair = itertools.combinations(list(map(int, input().split())), 2)
res = [i[0] * i[1] for i in pair]
res.sort()
if len(res) != 0:
    print(res[K-1])

Submission status: Runtime Error

Solution code:
import itertools
N, K = map(int, input().split())
pair = itertools.combinations(map(int, input().split()), 2)
res = [i[0] * i[1] for i in pair]
res.sort()
if len(res) != 0:
    print(res[K-1])

Submission status: Runtime Error

Solution code:
def main():
    n =int( input())
    sn=[]
    for i in range(n):
        
        inWord = str(input())
        addFlag = True
        for s in sn:
            if s["word"] == inWord and len(sn) !=0:
                s["count"]+=1
                addFlag = False
                break
        if addFlag ==True:
            sn.append( {"word":inWord,"count":1})
        
    a= sorted(sn, reverse=True,key=lambda x:x['count'])
    most = a[0]["count"]

    mostWords=[]
    for elm in a:
        if elm["count"] == most:
            mostWords.append(elm["word"])
        
    mostWords.sort()
    for elm in mostWords:
        print(elm)
    return
main()

Submission status: Runtime Error

Solution code:
number1 = int(input('Enter First number : '))
number2 = int(input('Enter Second number : '))
number3 = int(input('Enter Third number : '))
def largest(num1, num2, num3):
    if (num1 = num2) and (num1 = num3):
        print("No")
        return 0; 
    elif (num1 = num2):
        print("Yes")
        return 0; 
    elif (num1 = num3):
        print("Yes")
        return 0; 
    elif (num2 = num3):
        print("Yes")
        return 0; 
    else:
    print("Not valid input")

Submission status: Runtime Error

Solution code:

def main():
    n =int( input())
    sn=[]
    for i in range(n):
        
        inWord = str(input())
        addFlag = True
        for s in sn:
            if s["word"] == inWord and len(sn) !=0:
                s["count"]+=1
                addFlag = False
                break
        if addFlag ==True:
            sn.append( {"word":inWord,"count":1})
        
    a= sorted(sn, reverse=True,key=lambda x:x['count'])
    most = a[0]["count"]

    mostWords=[]
    for elm in a:
        if elm["count"] == most:
            mostWords.append(elm["word"])
    mostWords.sort()

    for elm in mostWords:
        print(elm)
    return

main()

Submission status: Runtime Error

Solution code:
import numpy as np
from operator import itemgetter

N=int(input())
List=[str(input()) for i in range(N)]
SetList=list(set(List))
nc=[List.count(SetList[i]) for i in range(len(SetList))]

indexmax=np.where(np.array(nc) == np.array(nc).max())[0]
if(len(indexmax)==1):
    print(itemgetter(*indexmax)(SetList))
else:
    for i in sorted(itemgetter(*indexmax)(SetList)):
        print(i)

Submission status: Runtime Error

Solution code:

def main():
    n =int( input())
    sn=[]
    for i in range(n):
        
        inWord = str(input())
        addFlag = True
        for s in sn:
            if s["word"] == inWord and len(sn) !=0:
                s["count"]+=1
                addFlag = False
                break
        if addFlag ==True:
            sn.append( {"word":inWord,"count":1})
        
    a= sorted(sn, reverse=True,key=lambda x:x['count'])
    most = a[0]["count"]

    mostWords=[]
    for elm in a:
        if elm["count"] == most:
            mostWords.append(elm["word"])
        else:
            break
        
    mostWords.sort()

    for elm in mostWords:
        print(elm)
    return

main()

Submission status: Runtime Error

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

#入力
a, b, c = map(int, input().split()

if a == b == c:
    print('NO')

elif a != b and b != c and c != a:
    print('NO')
else:
    print('YES')

Submission status: Runtime Error

Solution code:
A = int(input('A:'))
B = int(input('B:'))
C = int(input('C:'))
 
if A == B and C!=A:
    print('Yes')
elif A==C and B!=A:
    print('Yes')
elif B==C and A!=B:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:

def main():
    n =int( input())
    sn=[]
    for i in range(n):
        
        inWord = str(input())
        addFlag = True
        for s in sn:
            if s["word"] == inWord and len(sn) !=0:
                s["count"]+=1
                addFlag = False
                break
        if addFlag ==True:
            sn.append( {"word":inWord,"count":1})
        
    a= sorted(sn, reverse=True,key=lambda x:x['count'])
    most = a[0]["count"]

    mostWords=[]
    for elm in a:
        if elm["count"] == most:
            mostWords.append(elm["word"])
        else :
            break
        
    mostWords.sort()

    for elm in mostWords:
        print(elm)
    return

main()

Submission status: Runtime Error

Solution code:
n=int(input())
a = [input() for i in range(n)]
b = sorted(list(set(a)))
d = {}
for i in b:
    t = a.count(i)
    d.setdefault(t,[])
    d[t].append(i)

for i in d[max(d.keys())]:
    print(i)

Submission status: Runtime Error

Solution code:
import itertools
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=sorted([x[0]*x[1] for x in itertools.combinations(a,2)],reverse=False)
print(b[k-1])

Submission status: Runtime Error

Solution code:
import collections
n = int(input())
li=[input() for _ in range(n)]
c = collections.Counter(li)
max_list = [kv[0] for kv in c.items() if kv[1] == max(c.values())]
max_list.sort()
for s in max_list:
  print(s)

Submission status: Runtime Error

Solution code:
import itertools
N, K = map(int, input().split())
input_n = list(map(int, input().split()))
pair = itertools.combinations(input_n, 2)
res = [i[0] * i[1] for i in pair]
res.sort()
print(res[K-1])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
mylist = []
x = input()
mylist.append(int(x))

y = input()
mylist.append(int(y))

z = input()
mylist.append(int(z))

def has_duplicates(seq):
    return len(seq) != len(set(seq))

if not has_duplicates(mylist) or x == y == z:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
import numpy as np
import itertools
[n,k]=map(int,input().split())
a=np.array(list(map(int,input().split())))

c=sorted([x * y for x, y in itertools.combinations(a,2)])
print(c[k-1])

Submission status: Runtime Error

Solution code:
nums= input().split()


for i in range(len(nums)):
    nums[i] = int(nums[i])
    
nums.sort()


if nums[1] == nums[2] and nums[0]<nums[1]:
    print(Yes)
elif nums[1] == nums[0] and nums[1]<nums[2]:
    print(Yes)
else:
    print(No)

Submission status: Runtime Error

Solution code:
from collections import Counter
N = (int)(input())
A = [input() for i in range(N)]

B = Counter(A)


max = [kv for kv in B.items() if kv[1] == max(B.values())]

for i in reversed(max):
    print(i[0])

Submission status: Runtime Error

Solution code:
N = int(input())
import collections
mylist = []
for i in range(N):
  val = input("")
  if val:
    mylist.append(val)
if len(mylist) != len(set(mylist)):
    c = collections.Counter(mylist)
    A = [i for i in range(len(set(mylist))) if c.most_common()[0][1] == c.most_common()[i][1]]
    B = [c.most_common()[i][0] for i in range(len(A))]
    C = sorted(B)
    for item in C:
        print(item)
else:
    D = sorted(mylist)
    for item in D:
            print(item)

Submission status: Runtime Error

Solution code:
import sys
import collections
n = int(input())
li=[input() for _ in range(n)]
c = collections.Counter(li)
max_list = [kv[0] for kv in c.items() if kv[1] == max(c.values())]
max_list.sort()
for s in max_list:
  print(s)

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
A=list(map(int,input().split()))
ans=[]
for i in range(N):
    for j in range(i+1,N):
        ans.append(A[i]*A[j])
print(sorted(ans)[K-1])

Submission status: Runtime Error

Solution code:
n, k = [int(x) for x in input().split()]
nums = [int(x) for x in input().split()]
nums.sort()
if 0 in nums:
  index = nums.index(0)
  if index == 0:
    print(nums[1] * nums[k]
    break
  if index == n-1:
    print(nums[-2] * nums[-k - 1]
  else:
      num_neg = index
      num_pos = n - index
      if k < num_neg * num_pos:
          s = k // num_pos
          f = k % num_pos
          if f == 0:
              print(nums[-s] * nums[index+1])
          else:
              print(nums[-s-1] * nums[-f-1])
      else:
          new_list = nums[index:] + [-x for x in nums[:inedex]]
          new_list.sort()
          print(new_list[1] * new_list[k]
else:
    l, h = 0, n - 1
    while l < h:
        m = (l+h) // 2
        if nums[m] >= 0:
            h = m
        else:
            l = m + 1
        index = l
    num_neg = index
    num_pos = n - index
    if k < num_neg * num_pos:
        s = k // num_pos
        f = k % num_pos
        if f == 0:
            print(nums[-s] * nums[index+1])
        else:
            print(nums[-s-1] * nums[-f-1])
    else:
        new_list = nums[index:] + [-x for x in nums[:inedex]]
        new_list.sort()
        print(new_list[0] * new_list[k-1]

Submission status: Runtime Error

Solution code:
l=list(map(int,input().split())
if len(set(l))==2:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
j = int(input())
i = list(map(int, input().split()))
l=0
for k in range(j):
    if i[k]%2==0:
        if i[k]%3!=0 and i[k]%5!=0:
            print('DENIED')
            l=1
            break
if l == 0:
    print('APPROVED')

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))

count = 1
li = []

for index, a in enumerate(A):
  for b in range(count, len(A)):
    li.append(a * A[b])

  count += 1

li.sort()

print(li[K-1])

Submission status: Runtime Error

Solution code:
N=int(input())
S = []
for j in range(N):
    S.append(input())
from collections import Counter
S2=collections.Counter(S)
S1=S2.most_common()

S3=[]
S3.append(S1[0][0])
for i in range(1,len(S1)):
    if S1[i][1]==S1[0][1]:
        S3.append(S1[i][0])
    else:
        break
S3=' '.join(sorted(S3))
print(S3)

Submission status: Runtime Error

Solution code:
a,b,c=map(int, input.split())
count = 0
if a==b:
  count = count + 1
if b==c:
  count = count + 1
if c==a:
  count = count + 1
if count == 1:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
#!usr/bin/env python3


import sys


def I(): return int(sys.stdin.readline())


def solve():
    n = I()
    sli = [input() for i in range(n)]
    setli = set(sli)
    rank = {}
    for i in setli:
        j = sli.count(i)
        rank[i] = j
    for i in sorted([k for k, v in rank.items() if v == max(rank.values())]):
        print(i)


# Solve
if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
judge = True
for i in range(a):
  b = int(input())
  if (b % 2 == 0) and ((b % 3 == 0) or (b % 5 == 0)):
    judge = False
# 出力
if judge:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
x = int(input())
y = int(input())
z = int(input())
if x == y or y == z or x == z:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N=int(input())
i=list(map(int,input().split()))
a=0
for x in range(N):
    if i[x]%2==0:
        if i[x]%3!=0:
            if i[x]%5!=0:
                x+=1
if a==0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
lst = [int(x) for x in input().split()]
newLst = []

for i in range(n-1):
    for j in range(i+1, n):
        newLst.append(lst[i]*lst[j])

newLst = sorted(newLst)
print(newLst[k-1])

Submission status: Runtime Error

Solution code:
A，B，C = list(map(int, input().split()))
vincent = [A,B,C]
vincent1 = set(vincent)
if len(vincent1) == 2:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
n = input()
_list = input().split(" ")
_list = [int(x) for x in _list]
even = [x for x in _list if x % 2 == 0]
answer = []
for x in even:
    if x % 3 == 0 or x % 5 == 0:
        answer.append(True)
if len(even) == len(answer):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
N=int(input())
i=list(map(int,input().split()))
x=0
for x in range(N):
  if x%2==0:
    if x%3!=0:
      if x%5!=0:
        x+=1
if x==0:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
n = input()
_list = input().split(" ")
_list = [int(x) for x in _list]
even = [x for x in _list if x % 2==0]
answer = []
for x in even:
    if x % 3 == 0 or x % 5 == 0:
        answer.append(True)
if len(even) ==len(answer):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))

flag = 0
for i in range(len(a)):
    if a[i]%2 == 0:
        if a[i]%3 == 0 or a[i]%5 == 0:
            flag += 1
        else:
            flag = 0
            break

if flag != 0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
A，B，C = list(map(str, input().split()))
vincent = [A,B,C]
vincent1 = list(set(vincent))
if len(vincent1) == 2:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
N=int(input())
i=list(map(int,input().split()))
x=0
for x in range(N):
  if x%2==0:
    if x%3!=0:
      if x%5!=0:
        x+=1
if x==0:
  return "APPROVED"
else:
  return "DENIED"

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
if a==b==c or a!=b!=c:
  print("No")
elif a==b!=c or a!=b==c or a==c!=b:
  print("Yes")
else：
  print("No")

Submission status: Runtime Error

Solution code:
n=int(input())
string_list=[input() for i in range(n)]
import collections
import numpy as np
c = collections.Counter(string_list)
d=c.most_common()
x=int(d[0][1])
z=[]
for i in range(len(d)):
  y=int(d[i][1])
  if x==y:
    z.append(str(d[i][0]))
    
z.sort()
for i in range(len(z)):
  print(z[i])

Submission status: Runtime Error

Solution code:
from collections import  Counter
N = int(input())
votes = [input() for i in range(N)]
count = dict(Counter(votes))
max_vote = max(count.values())
res = []
for i in count:
    if count[i] == max_vote:
        res.append(i)
        continue
res.sort()
for i in res:
    print(i)

Submission status: Runtime Error

Solution code:
def Main(A,B,C):

  if A == B:
    if C!=A:
      print("Yes",end="")
    else:
      print("No",end="")
  elif A == C:
    if B!=A:
      print("Yes",end="")
    else :
      print("No",end="")
  elif B == C:
    if A!=B :
      print("Yes",end="")
    else:
      print("No",end="")
  else:
    print("No",end="")
A = int(input())
B = int(input())
C = int(input())
Main(A,B,C)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
mylist = []

print('1つ目の数入力')
x = input()
mylist.append(int(x))

print('2つ目の数入力')
y = input()
mylist.append(int(y))

print('3つ目の数入力')
z = input()
mylist.append(int(z))

print(mylist)

def has_duplicates(seq):
    return len(seq) != len(set(seq))

if not has_duplicates(mylist) or x == y == z:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
A，B，C=list(map(int,input().split()))
vincent=[A,B,C]
vincent1=list(set(vincent))
if len(vincent1)==2:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
s = [input() for i in range(n)]

d = {}
for i in range(n):
    if s[i] in d:
        d[s[i]] += 1
    else:
        d[s[i]] = 1

ma = [m[0] for m in d.items() if m[1] == max(d.values())]
print(*sorted(ma))

Submission status: Runtime Error

Solution code:
import collections

N = int(input())

S = [input() for i in range(N)]

result = collections.Counter(S)

result_max = sorted([i for i in result.keys() if result[i] == max(result.values())])

for r in result_max:
    print(r)

Submission status: Runtime Error

Solution code:
n = int(input())
m = list(map(int,input().split()))
f = True
for i in m:
  if i % 2 == 0:
    if (i % 3 == 0 ) or (i % 5 == 0 ):
      f = True
    else:
      print('DENIED')
      exit()

print('APPROVED')