message
stringlengths
2
43.5k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
853
107k
cluster
float64
24
24
__index_level_0__
int64
1.71k
214k
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has a lot of work to do. Recently he has learned a new time management rule: "if a task takes five minutes or less, do it immediately". Polycarp likes the new rule, however he is not su...
instruction
0
97,856
24
195,712
No
output
1
97,856
24
195,713
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has a lot of work to do. Recently he has learned a new time management rule: "if a task takes five minutes or less, do it immediately". Polycarp likes the new rule, however he is not su...
instruction
0
97,857
24
195,714
No
output
1
97,857
24
195,715
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. For that Polycarpus performs the following operat...
instruction
0
98,912
24
197,824
Tags: greedy, math Correct Solution: ``` n=int(input()) arr=list(map(int,input().split())) s=0 for i in range(n): s+=arr[i] if s%n==0: print(n) else: print(n-1) ```
output
1
98,912
24
197,825
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. For that Polycarpus performs the following operat...
instruction
0
98,913
24
197,826
Tags: greedy, math Correct Solution: ``` # It's all about what U BELIEVE def gint(): return int(input()) def gint_arr(): return list(map(int, input().split())) def gfloat(): return float(input()) def gfloat_arr(): return list(map(float, input().split())) def pair_int(): return map(int, input().split()) ################...
output
1
98,913
24
197,827
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. For that Polycarpus performs the following operat...
instruction
0
98,914
24
197,828
Tags: greedy, math Correct Solution: ``` def IC(): n=int(input()) a=[int(x) for x in input().split()] shave=sum(a) if shave % n == 0: print(n) return else: print(n-1) return IC() ```
output
1
98,914
24
197,829
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. For that Polycarpus performs the following operat...
instruction
0
98,915
24
197,830
Tags: greedy, math Correct Solution: ``` from math import pi def main(): n = int(input()) s = sum(map(int, input().split())) if s % n: n -= 1 print(n) if __name__ == '__main__': main() ```
output
1
98,915
24
197,831
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. For that Polycarpus performs the following operat...
instruction
0
98,916
24
197,832
Tags: greedy, math Correct Solution: ``` def fun (x,l): if(len(set(x))==1): print(l) return if(sum(x)%l==0): print(l) else: print(l-1) return l = int(input()) x=list(map(int,input().split())) x.sort() fun(x,l) ```
output
1
98,916
24
197,833
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. For that Polycarpus performs the following operat...
instruction
0
98,917
24
197,834
Tags: greedy, math Correct Solution: ``` n=int(input()) summ=sum(map(int,input().split())) if summ%n==0: print(n) else: print(n-1) ```
output
1
98,917
24
197,835
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. For that Polycarpus performs the following operat...
instruction
0
98,918
24
197,836
Tags: greedy, math Correct Solution: ``` '''input 6 -1 1 0 0 -1 -1 ''' n = int(input()) a = list(map(int, input().split())) print(n if sum(a) % n == 0 else n - 1) ```
output
1
98,918
24
197,837
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. For that Polycarpus performs the following operat...
instruction
0
98,919
24
197,838
Tags: greedy, math Correct Solution: ``` n=int(input()) print( n if sum((map(int,input().split())))%n==0 else n-1) ```
output
1
98,919
24
197,839
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. Fo...
instruction
0
98,920
24
197,840
Yes
output
1
98,920
24
197,841
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. Fo...
instruction
0
98,921
24
197,842
Yes
output
1
98,921
24
197,843
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. Fo...
instruction
0
98,922
24
197,844
Yes
output
1
98,922
24
197,845
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. Fo...
instruction
0
98,923
24
197,846
Yes
output
1
98,923
24
197,847
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. Fo...
instruction
0
98,924
24
197,848
No
output
1
98,924
24
197,849
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. Fo...
instruction
0
98,925
24
197,850
No
output
1
98,925
24
197,851
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. Fo...
instruction
0
98,926
24
197,852
No
output
1
98,926
24
197,853
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. Fo...
instruction
0
98,927
24
197,854
No
output
1
98,927
24
197,855
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the color and bj is the diameter. Cap (aj, bj) can clos...
instruction
0
99,695
24
199,390
Tags: *special, greedy, sortings Correct Solution: ``` from functools import cmp_to_key def main(): n, m = map(int, input().split()) markers = [] caps = [] for _ in range(n): x, y = map(int, input().split()) markers.append((x, y)) for _ in range(m): x, y = map(int, input(...
output
1
99,695
24
199,391
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the color and bj is the diameter. Cap (aj, bj) can clos...
instruction
0
99,696
24
199,392
Tags: *special, greedy, sortings Correct Solution: ``` import sys import time import math from collections import defaultdict from functools import lru_cache INF = 10 ** 18 + 3 EPS = 1e-10 MAX_CACHE = 10 ** 9 def time_it(function, output=sys.stderr): def wrapped(*args, **kwargs): start = time.time() ...
output
1
99,696
24
199,393
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the color and bj is the diameter. Cap (aj, bj) can clos...
instruction
0
99,697
24
199,394
Tags: *special, greedy, sortings Correct Solution: ``` n, m = map(int, input().split()) x, y, u, v = {}, {}, 0, 0 for i in range(n): a, b = input().split() if b in x: x[b][a] = x[b].get(a, 0) + 1 else: x[b] = {a: 1} for i in range(m): a, b = input().split() if b in y: y[b][a] = y[b].get(a, 0...
output
1
99,697
24
199,395
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the color and bj is the diameter. Cap (aj, bj) can clos...
instruction
0
99,698
24
199,396
Tags: *special, greedy, sortings Correct Solution: ``` n,m=map(int,input().split()) m1={} m2={} c1={} c2={} for i in range(n): x,y=(map(int,input().split())) m1[y]=m1.get(y,0)+1 m2[(x,y)]=m2.get((x,y),0)+1 for i in range(m): x,y=(map(int,input().split())) c1[y]=c1.get(y,0)+1 c2[(x,y)]=c2.get((x,...
output
1
99,698
24
199,397
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the color and bj is the diameter. Cap (aj, bj) can clos...
instruction
0
99,699
24
199,398
Tags: *special, greedy, sortings Correct Solution: ``` # n=int(input()) # n,k=map(int,input().split()) # arr=list(map(int,input().split())) #ls=list(map(int,input().split())) #for i in range(m): # for _ in range(int(input())): #from collections import Counter #from fractions import Fraction #s=iter(input()) #from colle...
output
1
99,699
24
199,399
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the color and bj is the diameter. Cap (aj, bj) can clos...
instruction
0
99,700
24
199,400
Tags: *special, greedy, sortings Correct Solution: ``` n,m=map(int,input().split()) p=[list(map(int,input().split())) for i in range(n)] dic1={} dic2={} for i in range(m): x,y=map(int,input().split()) dic1[(x,y)]=dic1.get((x,y),0)+1 dic2[y]=dic2.get(y,0)+1 c1=0 c2=0 for x in p: if dic1.get((x[0],x[1])):...
output
1
99,700
24
199,401
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the color and bj is the diameter. Cap (aj, bj) can clos...
instruction
0
99,701
24
199,402
Tags: *special, greedy, sortings Correct Solution: ``` def main(): from sys import stdin l = list(map(int, stdin.read().split())) n, yx = l[0] * 2, [[0] * 1001 for _ in range(1001)] cnt = yx[0] u = v = 0 for y, x in zip(l[3:n + 3:2], l[2:n + 2:2]): cnt[y] += 1 yx[y][x] += 1 b...
output
1
99,701
24
199,403
Provide tags and a correct Python 3 solution for this coding contest problem. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the color and bj is the diameter. Cap (aj, bj) can clos...
instruction
0
99,702
24
199,404
Tags: *special, greedy, sortings Correct Solution: ``` from collections import Counter def read_ints(): return tuple(int(x) for x in input().split()) def parse_input(size): data = [read_ints() for _ in range(size)] by_diam = Counter(size for diam, size in data) by_color = Counter(data) return by_d...
output
1
99,702
24
199,405
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the colo...
instruction
0
99,703
24
199,406
Yes
output
1
99,703
24
199,407
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the colo...
instruction
0
99,704
24
199,408
Yes
output
1
99,704
24
199,409
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the colo...
instruction
0
99,705
24
199,410
Yes
output
1
99,705
24
199,411
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the colo...
instruction
0
99,706
24
199,412
Yes
output
1
99,706
24
199,413
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the colo...
instruction
0
99,707
24
199,414
No
output
1
99,707
24
199,415
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the colo...
instruction
0
99,708
24
199,416
No
output
1
99,708
24
199,417
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the colo...
instruction
0
99,709
24
199,418
No
output
1
99,709
24
199,419
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarpus has n markers and m marker caps. Each marker is described by two numbers: xi is the color and yi is the diameter. Correspondingly, each cap is described by two numbers: aj is the colo...
instruction
0
99,710
24
199,420
No
output
1
99,710
24
199,421
Provide tags and a correct Python 3 solution for this coding contest problem. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are numbered from 1 from lower to upper floors. That i...
instruction
0
99,997
24
199,994
Tags: brute force, implementation Correct Solution: ``` n, m = [int(i) for i in input().split()] mn = 10 ** 5 mx = 1 n -= 1 for i in range(m): x, y = [int(i) for i in input().split()] x -= 1 y -= 1 if y != 0: mn = min(mn, x // y) mx = max(mx, [(x + y) // (y + 1), x // (y + 1) + 1][x % (y + 1...
output
1
99,997
24
199,995
Provide tags and a correct Python 3 solution for this coding contest problem. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are numbered from 1 from lower to upper floors. That i...
instruction
0
99,998
24
199,996
Tags: brute force, implementation Correct Solution: ``` import math from sys import stdin from math import ceil if __name__ == '__main__': numbers = list(map(int, input().split())) n = numbers[0] m = numbers[1] floors = [] for i in range(m): floors.append(tuple(map(int, input().split()))) ...
output
1
99,998
24
199,997
Provide tags and a correct Python 3 solution for this coding contest problem. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are numbered from 1 from lower to upper floors. That i...
instruction
0
99,999
24
199,998
Tags: brute force, implementation Correct Solution: ``` #Code by Sounak, IIESTS #------------------------------warmup---------------------------- import os import sys import math from io import BytesIO, IOBase BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self....
output
1
99,999
24
199,999
Provide tags and a correct Python 3 solution for this coding contest problem. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are numbered from 1 from lower to upper floors. That i...
instruction
0
100,000
24
200,000
Tags: brute force, implementation Correct Solution: ``` import sys, os n, m = map(int, input().split()) mi = [] ma = [] if m == 0: if n == 1: print(1) else: print(-1) exit(0) sys.exit() os.abort() for i in range(m): a, b = map(int, input().split()) if b == 1: ma.appen...
output
1
100,000
24
200,001
Provide tags and a correct Python 3 solution for this coding contest problem. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are numbered from 1 from lower to upper floors. That i...
instruction
0
100,001
24
200,002
Tags: brute force, implementation Correct Solution: ``` def rec(i): global a return i import sys from collections import Counter sys.setrecursionlimit(10**6) #n=int(input()) n,m=list(map(int,input().split())) a=[[] for i in range(100)] b=[i for i in range(1,101)] for i in range(m): x,y=list(map(int,input()....
output
1
100,001
24
200,003
Provide tags and a correct Python 3 solution for this coding contest problem. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are numbered from 1 from lower to upper floors. That i...
instruction
0
100,002
24
200,004
Tags: brute force, implementation Correct Solution: ``` n,m=map(int,input().split()) n-=1 k=[] f=[] p=0 for i in range(m): q=list(map(int,input().split())) k.append(q[0]) f.append(q[1]) for i in range(1,101): for j in range(m): if ((k[j]-1)//i)+1!=f[j]: break else: if not...
output
1
100,002
24
200,005
Provide tags and a correct Python 3 solution for this coding contest problem. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are numbered from 1 from lower to upper floors. That i...
instruction
0
100,003
24
200,006
Tags: brute force, implementation Correct Solution: ``` from math import ceil n, m = map(int, input().split()) k = [0 for i in range(m)] f = [0 for i in range(m)] x = -1 for i in range(m): k[i], f[i] = map(int, input().split()) i = 0 while i < m: j = i while j < m: if abs(k[i] - k[j]) == 1 and abs(f...
output
1
100,003
24
200,007
Provide tags and a correct Python 3 solution for this coding contest problem. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are numbered from 1 from lower to upper floors. That i...
instruction
0
100,004
24
200,008
Tags: brute force, implementation Correct Solution: ``` def xor(a,b,i): if (((a-1)//i)==(b-1)): return True elif(a<i) and (b==1): return True else: return False dannie = input() dannie = dannie.split(' ') level = int(dannie[0]) n = int(dannie[1]) levels = [] if level == 1: pri...
output
1
100,004
24
200,009
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are num...
instruction
0
100,005
24
200,010
Yes
output
1
100,005
24
200,011
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are num...
instruction
0
100,006
24
200,012
Yes
output
1
100,006
24
200,013
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are num...
instruction
0
100,007
24
200,014
Yes
output
1
100,007
24
200,015
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are num...
instruction
0
100,008
24
200,016
Yes
output
1
100,008
24
200,017
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are num...
instruction
0
100,009
24
200,018
No
output
1
100,009
24
200,019
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are num...
instruction
0
100,010
24
200,020
No
output
1
100,010
24
200,021
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are num...
instruction
0
100,011
24
200,022
No
output
1
100,011
24
200,023
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are num...
instruction
0
100,012
24
200,024
No
output
1
100,012
24
200,025