message
stringlengths
2
22.7k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
145
109k
cluster
float64
9
9
__index_level_0__
int64
290
217k
Provide tags and a correct Python 3 solution for this coding contest problem. One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w kilos. They rushed home, dying of thirst, a...
instruction
0
85,333
9
170,666
Tags: brute force, math Correct Solution: ``` def solve(): w = int(input()) if w <= 2 or w % 2 != 0: print("NO") else: print("YES") if __name__ == '__main__': solve() ```
output
1
85,333
9
170,667
Provide tags and a correct Python 3 solution for this coding contest problem. One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w kilos. They rushed home, dying of thirst, a...
instruction
0
85,334
9
170,668
Tags: brute force, math Correct Solution: ``` a = input() a = int(a) if a % 2 == 0 and a != 2: print('YES') else: print('NO') ```
output
1
85,334
9
170,669
Provide tags and a correct Python 3 solution for this coding contest problem. One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w kilos. They rushed home, dying of thirst, a...
instruction
0
85,335
9
170,670
Tags: brute force, math Correct Solution: ``` i = int(input()) b = False for g in range(0,i): if g % 2 == 0 and (i - g) % 2 == 0 and g != 0: print("YES") b = True break if b == False: print("NO") ```
output
1
85,335
9
170,671
Provide tags and a correct Python 3 solution for this coding contest problem. One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w kilos. They rushed home, dying of thirst, a...
instruction
0
85,336
9
170,672
Tags: brute force, math Correct Solution: ``` weight = float(input()) try: #assert weight.is_integer() and (weight <= 100 and weight >= 1) and (weight/2 % 2 == 0) assert weight.is_integer() and (weight <= 100 and weight > 2) and ((weight - 2) % 2 == 0) #If weight is 2 then its NO print("YES") except Assert...
output
1
85,336
9
170,673
Provide tags and a correct Python 3 solution for this coding contest problem. Nick has n bottles of soda left after his birthday. Each bottle is described by two values: remaining amount of soda ai and bottle volume bi (ai ≀ bi). Nick has decided to pour all remaining soda into minimal number of bottles, moreover he ...
instruction
0
86,169
9
172,338
Tags: dp Correct Solution: ``` f = lambda: list(map(int, input().split())) n = int(input()) a, b = f(), f() d = [[None] * 10001 for i in range(n)] def g(i, s): if s <= 0: return (0, s) if i == n: return (1e7, 0) if not d[i][s]: x, y = g(i + 1, s - b[i]) d[i][s] = min(g(i + 1, s), (x + 1, ...
output
1
86,169
9
172,339
Provide tags and a correct Python 3 solution for this coding contest problem. Nick has n bottles of soda left after his birthday. Each bottle is described by two values: remaining amount of soda ai and bottle volume bi (ai ≀ bi). Nick has decided to pour all remaining soda into minimal number of bottles, moreover he ...
instruction
0
86,170
9
172,340
Tags: dp Correct Solution: ``` import math from collections import defaultdict import os import sys from io import BytesIO, IOBase from types import GeneratorType from collections import defaultdict BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = file.fileno() ...
output
1
86,170
9
172,341
Provide tags and a correct Python 3 solution for this coding contest problem. Nick has n bottles of soda left after his birthday. Each bottle is described by two values: remaining amount of soda ai and bottle volume bi (ai ≀ bi). Nick has decided to pour all remaining soda into minimal number of bottles, moreover he ...
instruction
0
86,171
9
172,342
Tags: dp Correct Solution: ``` import sys input = sys.stdin.buffer.readline n = int(input()) soda = list(map(int, input().split())) volume = list(map(int, input().split())) dp = [[{} for j in range(n + 1)] for k in range(n + 1)] dp[0][1][volume[0] - soda[0]] = 0 total = soda[0] for i in range(0, n - 1): total += ...
output
1
86,171
9
172,343
Provide tags and a correct Python 3 solution for this coding contest problem. Nick has n bottles of soda left after his birthday. Each bottle is described by two values: remaining amount of soda ai and bottle volume bi (ai ≀ bi). Nick has decided to pour all remaining soda into minimal number of bottles, moreover he ...
instruction
0
86,172
9
172,344
Tags: dp Correct Solution: ``` # minTime[bottle][bottlesUsed][volume] n = int(input()) a = [int(x) for x in input().split()] b = [int(x) for x in input().split()] minTime = [[{} for j in range(101)] for k in range(101)] minTime[1][1][b[0] - a[0]] = 0 minTime[1][0][-a[0]] = a[0] validVolumes = {-a[0], b[0]-a[0]}...
output
1
86,172
9
172,345
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Nick has n bottles of soda left after his birthday. Each bottle is described by two values: remaining amount of soda ai and bottle volume bi (ai ≀ bi). Nick has decided to pour all remaining so...
instruction
0
86,173
9
172,346
No
output
1
86,173
9
172,347
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Nick has n bottles of soda left after his birthday. Each bottle is described by two values: remaining amount of soda ai and bottle volume bi (ai ≀ bi). Nick has decided to pour all remaining so...
instruction
0
86,174
9
172,348
No
output
1
86,174
9
172,349
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Nick has n bottles of soda left after his birthday. Each bottle is described by two values: remaining amount of soda ai and bottle volume bi (ai ≀ bi). Nick has decided to pour all remaining so...
instruction
0
86,175
9
172,350
No
output
1
86,175
9
172,351
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Nick has n bottles of soda left after his birthday. Each bottle is described by two values: remaining amount of soda ai and bottle volume bi (ai ≀ bi). Nick has decided to pour all remaining so...
instruction
0
86,176
9
172,352
No
output
1
86,176
9
172,353
Provide a correct Python 3 solution for this coding contest problem. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute the packs between the two students so that each student g...
instruction
0
86,433
9
172,866
"Correct Solution: ``` A = sorted(map(int, input().split())) print("Yes" if sum(A[:2]) == A[2] else "No") ```
output
1
86,433
9
172,867
Provide a correct Python 3 solution for this coding contest problem. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute the packs between the two students so that each student g...
instruction
0
86,434
9
172,868
"Correct Solution: ``` A = list(map(int, input().split())) print('Yes' if sum(A)/2 in A else 'No') ```
output
1
86,434
9
172,869
Provide a correct Python 3 solution for this coding contest problem. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute the packs between the two students so that each student g...
instruction
0
86,435
9
172,870
"Correct Solution: ``` L=list(map(int,input().split())) print('YNeos'[2*max(L)!=sum(L)::2]) ```
output
1
86,435
9
172,871
Provide a correct Python 3 solution for this coding contest problem. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute the packs between the two students so that each student g...
instruction
0
86,436
9
172,872
"Correct Solution: ``` A=list(map(int,input().split())) print('Yes' if 2*max(A)==sum(A) else 'No') ```
output
1
86,436
9
172,873
Provide a correct Python 3 solution for this coding contest problem. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute the packs between the two students so that each student g...
instruction
0
86,437
9
172,874
"Correct Solution: ``` a,b,c=map(int,input().split()) print("Yes" if 2*max(a,b,c)==a+b+c else "No") ```
output
1
86,437
9
172,875
Provide a correct Python 3 solution for this coding contest problem. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute the packs between the two students so that each student g...
instruction
0
86,438
9
172,876
"Correct Solution: ``` a,b,c=map(int,input().split()) if 2*max(a,b,c)==a+b+c: print("Yes") else: print("No") ```
output
1
86,438
9
172,877
Provide a correct Python 3 solution for this coding contest problem. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute the packs between the two students so that each student g...
instruction
0
86,439
9
172,878
"Correct Solution: ``` a,b,c=sorted(map(int,input().split()));print("YNeos"[a+b!=c::2]) ```
output
1
86,439
9
172,879
Provide a correct Python 3 solution for this coding contest problem. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute the packs between the two students so that each student g...
instruction
0
86,440
9
172,880
"Correct Solution: ``` a,b,c = map(int, input().split()) print('Yes' if a+b==c or a==b+c or b==a+c else 'No') ```
output
1
86,440
9
172,881
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute t...
instruction
0
86,441
9
172,882
Yes
output
1
86,441
9
172,883
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute t...
instruction
0
86,442
9
172,884
Yes
output
1
86,442
9
172,885
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute t...
instruction
0
86,443
9
172,886
Yes
output
1
86,443
9
172,887
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute t...
instruction
0
86,444
9
172,888
Yes
output
1
86,444
9
172,889
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute t...
instruction
0
86,445
9
172,890
No
output
1
86,445
9
172,891
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute t...
instruction
0
86,446
9
172,892
No
output
1
86,446
9
172,893
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute t...
instruction
0
86,447
9
172,894
No
output
1
86,447
9
172,895
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute t...
instruction
0
86,448
9
172,896
No
output
1
86,448
9
172,897
Provide tags and a correct Python 3 solution for this coding contest problem. Sasha and Kolya decided to get drunk with Coke, again. This time they have k types of Coke. i-th type is characterised by its carbon dioxide concentration <image>. Today, on the party in honour of Sergiy of Vancouver they decided to prepare ...
instruction
0
87,180
9
174,360
Tags: dfs and similar, graphs, shortest paths Correct Solution: ``` from collections import deque n, k = map(int, input().split()) d = set(int(x)-n for x in input().split()) q = deque() q.append(0) visited = {i : False for i in range(-1000, 1001)} dist = {i : 0 for i in range(-1000, 1001)} ans = -1...
output
1
87,180
9
174,361
Provide tags and a correct Python 3 solution for this coding contest problem. Sasha and Kolya decided to get drunk with Coke, again. This time they have k types of Coke. i-th type is characterised by its carbon dioxide concentration <image>. Today, on the party in honour of Sergiy of Vancouver they decided to prepare ...
instruction
0
87,181
9
174,362
Tags: dfs and similar, graphs, shortest paths Correct Solution: ``` n, k = map(int, input().split()) a = list(map(int, input().split())) a.sort() if n < a[0] or n > a[k - 1]: print(-1) else: b = [] b.append(a[0]) for i in a: if i != b[len(b) - 1]: b.append(i) d = {} for i in...
output
1
87,181
9
174,363
Provide tags and a correct Python 3 solution for this coding contest problem. Sasha and Kolya decided to get drunk with Coke, again. This time they have k types of Coke. i-th type is characterised by its carbon dioxide concentration <image>. Today, on the party in honour of Sergiy of Vancouver they decided to prepare ...
instruction
0
87,183
9
174,366
Tags: dfs and similar, graphs, shortest paths Correct Solution: ``` from collections import deque n, k = map(int, input().split()) conc = set(int(x) - n for x in input().split()) q = deque() q.append(0) visited = {i : False for i in range(-1000, 1001)} dist = {i : 0 for i in range(-1000, 1001)} ans...
output
1
87,183
9
174,367
Provide tags and a correct Python 3 solution for this coding contest problem. Sasha and Kolya decided to get drunk with Coke, again. This time they have k types of Coke. i-th type is characterised by its carbon dioxide concentration <image>. Today, on the party in honour of Sergiy of Vancouver they decided to prepare ...
instruction
0
87,185
9
174,370
Tags: dfs and similar, graphs, shortest paths Correct Solution: ``` from collections import deque MAX_A = 1000 def main(): n, k = map(int, input().split()) a = set(int(x) - n for x in input().split()) visited = [False] * (2 * MAX_A + 1) visited[n] = True Q = deque() Q.append((...
output
1
87,185
9
174,371
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sasha and Kolya decided to get drunk with Coke, again. This time they have k types of Coke. i-th type is characterised by its carbon dioxide concentration <image>. Today, on the party in honour ...
instruction
0
87,186
9
174,372
No
output
1
87,186
9
174,373
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sasha and Kolya decided to get drunk with Coke, again. This time they have k types of Coke. i-th type is characterised by its carbon dioxide concentration <image>. Today, on the party in honour ...
instruction
0
87,188
9
174,376
No
output
1
87,188
9
174,377
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sasha and Kolya decided to get drunk with Coke, again. This time they have k types of Coke. i-th type is characterised by its carbon dioxide concentration <image>. Today, on the party in honour ...
instruction
0
87,189
9
174,378
No
output
1
87,189
9
174,379
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small portion contains 3 chunks; a large one β€” 7 chunks. I...
instruction
0
87,228
9
174,456
Tags: greedy, implementation Correct Solution: ``` from sys import stdin, stdout n = int(stdin.readline()) for i in range(n): k = int(stdin.readline()) label = 0 for c in range(k + 1): if k >= c * 3 and not (k - c * 3) % 7: label = 1 if label: stdout.write('YES\n')...
output
1
87,228
9
174,457
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small portion contains 3 chunks; a large one β€” 7 chunks. I...
instruction
0
87,229
9
174,458
Tags: greedy, implementation Correct Solution: ``` n=int(input()) for i in range(n): k=int(input()) a=k//7 b=k%7 if b==0 or b%3==0: print("YES") else: while b%3!=0: b=b+7 if b<=k: print("YES") else: print("NO") ```
output
1
87,229
9
174,459
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small portion contains 3 chunks; a large one β€” 7 chunks. I...
instruction
0
87,230
9
174,460
Tags: greedy, implementation Correct Solution: ``` n = int(input()) #n, m = map(int, input().split()) #s = input() #c = list(map(int, input().split())) for i in range(n): x = int(input()) if x % 3 == 0 or x == 7 or x == 10 or x > 11: print('YES') else: print('NO') ```
output
1
87,230
9
174,461
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small portion contains 3 chunks; a large one β€” 7 chunks. I...
instruction
0
87,231
9
174,462
Tags: greedy, implementation Correct Solution: ``` a=('1','2','4','5','8','11') for i in range(int(input())): if input() in a: print('NO') else: print('YES') ```
output
1
87,231
9
174,463
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small portion contains 3 chunks; a large one β€” 7 chunks. I...
instruction
0
87,232
9
174,464
Tags: greedy, implementation Correct Solution: ``` t=int(input()) for _ in range(t): n=int(input()) if n in [1,2,4,5,8,11]: print("NO") else: print("YES") ```
output
1
87,232
9
174,465
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small portion contains 3 chunks; a large one β€” 7 chunks. I...
instruction
0
87,233
9
174,466
Tags: greedy, implementation Correct Solution: ``` n = int(input()) for i in range(n): q = int(input()) t = 0 for j in range(34): for k in range(34): if 3 * j + 7 * k == q: print("YES") t = 1 break if t == 1: break i...
output
1
87,233
9
174,467
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small portion contains 3 chunks; a large one β€” 7 chunks. I...
instruction
0
87,234
9
174,468
Tags: greedy, implementation Correct Solution: ``` n = int(input()) small = 3 large = 7 for i in range(n): c = int(input()) if c % small == 0 or c % large == 0: print('YES') else: need = False for j in range(34): x = c - small * j if x > 0 and x % large == 0:...
output
1
87,234
9
174,469
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small portion contains 3 chunks; a large one β€” 7 chunks. I...
instruction
0
87,235
9
174,470
Tags: greedy, implementation Correct Solution: ``` n=int(input()) for i in range(n): x=int(input()) f=True for j in range(34): for k in range(34): if j*3 +k*7==x: f=False if f: print("NO") else: print("YES") ```
output
1
87,235
9
174,471
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small porti...
instruction
0
87,236
9
174,472
Yes
output
1
87,236
9
174,473
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small porti...
instruction
0
87,237
9
174,474
Yes
output
1
87,237
9
174,475
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small porti...
instruction
0
87,238
9
174,476
Yes
output
1
87,238
9
174,477
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small porti...
instruction
0
87,239
9
174,478
Yes
output
1
87,239
9
174,479
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small porti...
instruction
0
87,240
9
174,480
No
output
1
87,240
9
174,481
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small porti...
instruction
0
87,241
9
174,482
No
output
1
87,241
9
174,483
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large portions. A small porti...
instruction
0
87,242
9
174,484
No
output
1
87,242
9
174,485