message
stringlengths
2
19.9k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
322
108k
cluster
float64
15
15
__index_level_0__
int64
644
217k
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. So nearly half of the winter is over and Maria is dreaming about summer. She's fed up with skates and sleds, she was dreaming about Hopscotch all night long. It's a very popular children's game....
instruction
0
22,224
15
44,448
Yes
output
1
22,224
15
44,449
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. So nearly half of the winter is over and Maria is dreaming about summer. She's fed up with skates and sleds, she was dreaming about Hopscotch all night long. It's a very popular children's game....
instruction
0
22,225
15
44,450
No
output
1
22,225
15
44,451
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. So nearly half of the winter is over and Maria is dreaming about summer. She's fed up with skates and sleds, she was dreaming about Hopscotch all night long. It's a very popular children's game....
instruction
0
22,226
15
44,452
No
output
1
22,226
15
44,453
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. So nearly half of the winter is over and Maria is dreaming about summer. She's fed up with skates and sleds, she was dreaming about Hopscotch all night long. It's a very popular children's game....
instruction
0
22,227
15
44,454
No
output
1
22,227
15
44,455
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. So nearly half of the winter is over and Maria is dreaming about summer. She's fed up with skates and sleds, she was dreaming about Hopscotch all night long. It's a very popular children's game....
instruction
0
22,228
15
44,456
No
output
1
22,228
15
44,457
Provide tags and a correct Python 3 solution for this coding contest problem. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 checkered board, each square is painted either black...
instruction
0
22,338
15
44,676
Tags: brute force, strings Correct Solution: ``` check=True for i in range(8): s=input() for j in range(1,len(s)): if(s[j]==s[j-1]): check=False break if(check): print("YES") else: print("NO") ```
output
1
22,338
15
44,677
Provide tags and a correct Python 3 solution for this coding contest problem. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 checkered board, each square is painted either black...
instruction
0
22,339
15
44,678
Tags: brute force, strings Correct Solution: ``` chess = [input() for i in range(8)] solve = 'YES' for c in chess: if 'WW' in c or 'BB' in c: solve = 'NO' break else: continue print(solve) ```
output
1
22,339
15
44,679
Provide tags and a correct Python 3 solution for this coding contest problem. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 checkered board, each square is painted either black...
instruction
0
22,340
15
44,680
Tags: brute force, strings Correct Solution: ``` l=[] flag=0 for i in range(8): l.append(input()) for j in range(1,8): if(l[i][j]==l[i][j-1]): flag=1 break if(flag==1): print("NO") else: print("YES") ```
output
1
22,340
15
44,681
Provide tags and a correct Python 3 solution for this coding contest problem. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 checkered board, each square is painted either black...
instruction
0
22,341
15
44,682
Tags: brute force, strings Correct Solution: ``` proper = True for i in range(8): raw = input() if raw != "WBWBWBWB" and raw != "BWBWBWBW": proper = False if proper: print("YES") else: print("NO") ```
output
1
22,341
15
44,683
Provide tags and a correct Python 3 solution for this coding contest problem. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 checkered board, each square is painted either black...
instruction
0
22,342
15
44,684
Tags: brute force, strings Correct Solution: ``` int1="WBWBWBWB" int2="BWBWBWBW" res=0 for i in range (8): line=str(input()) for j in range (len(line)): if line==int1 or line == int2: res+=1 if res/8==8: print("YES") else: print("NO") ```
output
1
22,342
15
44,685
Provide tags and a correct Python 3 solution for this coding contest problem. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 checkered board, each square is painted either black...
instruction
0
22,343
15
44,686
Tags: brute force, strings Correct Solution: ``` def chess(li): for i in range(8): for j in range(8): if li[i][0] == li[i][7]: return False if j+1<len(li) and li[i][j] == li[i][j+1] : return False return True li =[] for i in range(8): a=input() li.append(list(a)) if chess(li): print("YES") else:...
output
1
22,343
15
44,687
Provide tags and a correct Python 3 solution for this coding contest problem. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 checkered board, each square is painted either black...
instruction
0
22,344
15
44,688
Tags: brute force, strings Correct Solution: ``` for i in range(8): X = input() if "WW" in X or "BB" in X: print("NO") exit() print("YES") # UB_CodeForces # Advice: Falling down is an accident, staying down is a choice # Location: Here in Bojnurd # Caption: Being followed by my friend ESSI # C...
output
1
22,344
15
44,689
Provide tags and a correct Python 3 solution for this coding contest problem. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 checkered board, each square is painted either black...
instruction
0
22,345
15
44,690
Tags: brute force, strings Correct Solution: ``` chess =[] for i in range(8): chess.append(input()) flag = True for i in range(8): for j in range(7): if chess[i][j] == chess[i][j+1]: flag = False break if not flag: break if flag: print("YES") else: print("NO")...
output
1
22,345
15
44,691
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 check...
instruction
0
22,346
15
44,692
Yes
output
1
22,346
15
44,693
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 check...
instruction
0
22,347
15
44,694
Yes
output
1
22,347
15
44,695
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 check...
instruction
0
22,348
15
44,696
Yes
output
1
22,348
15
44,697
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 check...
instruction
0
22,349
15
44,698
Yes
output
1
22,349
15
44,699
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 check...
instruction
0
22,350
15
44,700
No
output
1
22,350
15
44,701
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 check...
instruction
0
22,351
15
44,702
No
output
1
22,351
15
44,703
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 check...
instruction
0
22,352
15
44,704
No
output
1
22,352
15
44,705
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Little Elephant loves chess very much. One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 check...
instruction
0
22,353
15
44,706
No
output
1
22,353
15
44,707
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a circular array with n elements. The elements are numbered from some element with values from 1 to n in clockwise order. The i-th cell contains the value ai. The robot Simba is in...
instruction
0
22,503
15
45,006
No
output
1
22,503
15
45,007
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Nauuo is a girl who loves playing games related to portals. One day she was playing a game as follows. In an n× n grid, the rows are numbered from 1 to n from top to bottom, the columns are nu...
instruction
0
22,911
15
45,822
No
output
1
22,911
15
45,823
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Furik and Rubik take part in a relay race. The race will be set up on a large square with the side of n meters. The given square is split into n × n cells (represented as unit squares), each cel...
instruction
0
23,130
15
46,260
No
output
1
23,130
15
46,261
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Furik and Rubik take part in a relay race. The race will be set up on a large square with the side of n meters. The given square is split into n × n cells (represented as unit squares), each cel...
instruction
0
23,131
15
46,262
No
output
1
23,131
15
46,263
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Furik and Rubik take part in a relay race. The race will be set up on a large square with the side of n meters. The given square is split into n × n cells (represented as unit squares), each cel...
instruction
0
23,132
15
46,264
No
output
1
23,132
15
46,265
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Furik and Rubik take part in a relay race. The race will be set up on a large square with the side of n meters. The given square is split into n × n cells (represented as unit squares), each cel...
instruction
0
23,133
15
46,266
No
output
1
23,133
15
46,267
Provide tags and a correct Python 3 solution for this coding contest problem. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line of the table contains one cell with a dwarf figu...
instruction
0
23,214
15
46,428
Tags: brute force, implementation, schedules Correct Solution: ``` n, m = map(int, input().split()) c = set(s.find("S") - s.find("G") for s in (input() for _ in range(n))) print(-1 if any(a < 0 for a in c) else len(c)) # Made By Mostafa_Khaled ```
output
1
23,214
15
46,429
Provide tags and a correct Python 3 solution for this coding contest problem. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line of the table contains one cell with a dwarf figu...
instruction
0
23,215
15
46,430
Tags: brute force, implementation, schedules Correct Solution: ``` n, m = map(int, input().split()) arr = [] ans = 0 flag = True for i in range(n): s = input() if(flag): gap = s.find("S") - s.find("G") if(gap > 0): if(gap not in arr): arr.append(gap) ans += 1 else: flag = False if(flag): print(an...
output
1
23,215
15
46,431
Provide tags and a correct Python 3 solution for this coding contest problem. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line of the table contains one cell with a dwarf figu...
instruction
0
23,216
15
46,432
Tags: brute force, implementation, schedules Correct Solution: ``` #!/usr/bin/python3 "B. Students and Shoelaces" "Codeforces Beta Round #94 (Div. 2 Only)" # n,m=map(int,input().split()) # d={} # for i in range(m): # z,x=map(int,input().split()) # d.setdefault(z,[]) # d.setdefault(x,[]) # d[z].append(x)...
output
1
23,216
15
46,433
Provide tags and a correct Python 3 solution for this coding contest problem. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line of the table contains one cell with a dwarf figu...
instruction
0
23,217
15
46,434
Tags: brute force, implementation, schedules Correct Solution: ``` n,m = list(map(int,input().split())) a = [] ans = set() for i in range(n): a.append(input()) ind_G = a[i].index('G') ind_S = a[i].index('S') if ind_S<ind_G: print(-1) exit() ans.add(ind_S-ind_G) print(len(ans)) ```
output
1
23,217
15
46,435
Provide tags and a correct Python 3 solution for this coding contest problem. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line of the table contains one cell with a dwarf figu...
instruction
0
23,218
15
46,436
Tags: brute force, implementation, schedules Correct Solution: ``` N = 1000 dis = set([]) n, m = map(int, input().split(' ')) f = False for i in range(n): s = input() dist = s.index('S') - s.index('G') #print(dist) if dist < 0: f = True break if dist not in dis: dis.add(dist)...
output
1
23,218
15
46,437
Provide tags and a correct Python 3 solution for this coding contest problem. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line of the table contains one cell with a dwarf figu...
instruction
0
23,219
15
46,438
Tags: brute force, implementation, schedules Correct Solution: ``` n, m = map(int, input().split()) s = set() prnt = True for i in range(n): row = list(input()) G = row.index("G") S = row.index("S") if S < G: print(-1) prnt = False break s.add(S - G) if prnt: ...
output
1
23,219
15
46,439
Provide tags and a correct Python 3 solution for this coding contest problem. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line of the table contains one cell with a dwarf figu...
instruction
0
23,220
15
46,440
Tags: brute force, implementation, schedules Correct Solution: ``` n,m=map(int,input().split(" ")) li=[] for i in range(n): s=input() li.append(s) fl=0 hs=[0]*1001 for i in range(n): cid=li[i].find('S') did=li[i].find('G') if cid<did: fl=1 break else: hs[cid-did]=1 if fl=...
output
1
23,220
15
46,441
Provide tags and a correct Python 3 solution for this coding contest problem. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line of the table contains one cell with a dwarf figu...
instruction
0
23,221
15
46,442
Tags: brute force, implementation, schedules Correct Solution: ``` n, m = map(int, input().split()) c = set(s.find("S") - s.find("G") for s in (input() for _ in range(n))) print(-1 if any(a < 0 for a in c) else len(c)) ```
output
1
23,221
15
46,443
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line o...
instruction
0
23,222
15
46,444
Yes
output
1
23,222
15
46,445
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line o...
instruction
0
23,223
15
46,446
Yes
output
1
23,223
15
46,447
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line o...
instruction
0
23,224
15
46,448
Yes
output
1
23,224
15
46,449
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line o...
instruction
0
23,225
15
46,450
Yes
output
1
23,225
15
46,451
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line o...
instruction
0
23,226
15
46,452
No
output
1
23,226
15
46,453
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line o...
instruction
0
23,227
15
46,454
No
output
1
23,227
15
46,455
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line o...
instruction
0
23,228
15
46,456
No
output
1
23,228
15
46,457
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Inna likes sweets and a game called the "Candy Matrix". Today, she came up with the new game "Candy Matrix 2: Reload". The field for the new game is a rectangle table of size n × m. Each line o...
instruction
0
23,229
15
46,458
No
output
1
23,229
15
46,459
Provide tags and a correct Python 3 solution for this coding contest problem. It's a beautiful April day and Wallace is playing football with his friends. But his friends do not know that Wallace actually stayed home with Gromit and sent them his robotic self instead. Robo-Wallace has several advantages over the other...
instruction
0
24,112
15
48,224
Tags: binary search, geometry Correct Solution: ``` from math import atan, asin y1, y2, yw, xb, yb, r = map(float, input().split()) x = xb * (yw - y1 - 2*r) / (2*yw - y1 - yb - 3*r) alpha = atan(x / (yw - y1 - 2*r)) beta = asin(r / (y2 - y1 - r)) print ('-1' if alpha < beta else '{0:.10f}'.format(x)) ```
output
1
24,112
15
48,225
Provide tags and a correct Python 3 solution for this coding contest problem. It's a beautiful April day and Wallace is playing football with his friends. But his friends do not know that Wallace actually stayed home with Gromit and sent them his robotic self instead. Robo-Wallace has several advantages over the other...
instruction
0
24,113
15
48,226
Tags: binary search, geometry Correct Solution: ``` from math import hypot y1, y2, yw, xb, yb, r = map(int, input().split()) yw -= r y1, y2 = yw * 2 - y2, yw * 2 - y1 def xww(y): return (y - yw) * xb / (y - yb) def dd(y): xw = xww(y) return (y - y1) / hypot(1, (yw - y) / xw) def binary_search(): a, b = y1 + ...
output
1
24,113
15
48,227
Provide tags and a correct Python 3 solution for this coding contest problem. It's a beautiful April day and Wallace is playing football with his friends. But his friends do not know that Wallace actually stayed home with Gromit and sent them his robotic self instead. Robo-Wallace has several advantages over the other...
instruction
0
24,114
15
48,228
Tags: binary search, geometry Correct Solution: ``` y1, y2, w, x, y, r = map(int, input().strip().split()) w -= r y1 = 2 * w - y1 - y - r y2 = 2 * w - y2 - y if x * x * (y2 - y1) * (y2 - y1) <= (y1 * y1 + x * x) * r * r: print(-1) else: print(f"{x * (y1 + y - w) / y1:.10f}") ```
output
1
24,114
15
48,229
Provide tags and a correct Python 3 solution for this coding contest problem. One evening Rainbow Dash and Fluttershy have come up with a game. Since the ponies are friends, they have decided not to compete in the game but to pursue a common goal. The game starts on a square flat grid, which initially has the outlin...
instruction
0
24,952
15
49,904
Tags: greedy, math Correct Solution: ``` for i in[*open(0)][1:]:print(int(i)//2+1) ```
output
1
24,952
15
49,905
Provide tags and a correct Python 3 solution for this coding contest problem. One evening Rainbow Dash and Fluttershy have come up with a game. Since the ponies are friends, they have decided not to compete in the game but to pursue a common goal. The game starts on a square flat grid, which initially has the outlin...
instruction
0
24,953
15
49,906
Tags: greedy, math Correct Solution: ``` import math for _ in range(int(input())): n = int(input()) if n == 1: print(1) elif n == 2 or n == 3: print(2) else: print(math.ceil(n // 2) + 1) ```
output
1
24,953
15
49,907
Provide tags and a correct Python 3 solution for this coding contest problem. One evening Rainbow Dash and Fluttershy have come up with a game. Since the ponies are friends, they have decided not to compete in the game but to pursue a common goal. The game starts on a square flat grid, which initially has the outlin...
instruction
0
24,954
15
49,908
Tags: greedy, math Correct Solution: ``` import sys from functools import lru_cache, cmp_to_key from heapq import merge, heapify, heappop, heappush from math import * from collections import defaultdict as dd, deque, Counter as C from itertools import combinations as comb, permutations as perm from bisect import bisect...
output
1
24,954
15
49,909
Provide tags and a correct Python 3 solution for this coding contest problem. One evening Rainbow Dash and Fluttershy have come up with a game. Since the ponies are friends, they have decided not to compete in the game but to pursue a common goal. The game starts on a square flat grid, which initially has the outlin...
instruction
0
24,955
15
49,910
Tags: greedy, math Correct Solution: ``` n = int(input()) for i in range(n): num = int(input()) print((num//2)+1) ```
output
1
24,955
15
49,911