Dataset Viewer
Auto-converted to Parquet Duplicate
message
stringlengths
2
39.6k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
450
109k
cluster
float64
2
2
__index_level_0__
int64
900
217k
Provide tags and a correct Python 3 solution for this coding contest problem. Vova plays a computer game known as Mages and Monsters. Vova's character is a mage. Though as he has just started, his character knows no spells. Vova's character can learn new spells during the game. Every spell is characterized by two val...
instruction
0
450
2
900
Tags: data structures, geometry Correct Solution: ``` #!/usr/bin/env python3 # solution after hint # (instead of best hit/mana spell store convex hull of spells) # O(n^2) instead of O(n log n) [q, m] = map(int, input().strip().split()) qis = [tuple(map(int, input().strip().split())) for _ in range(q)] mod = 10**6 ...
output
1
450
2
901
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vova plays a computer game known as Mages and Monsters. Vova's character is a mage. Though as he has just started, his character knows no spells. Vova's character can learn new spells during th...
instruction
0
451
2
902
No
output
1
451
2
903
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vova plays a computer game known as Mages and Monsters. Vova's character is a mage. Though as he has just started, his character knows no spells. Vova's character can learn new spells during th...
instruction
0
452
2
904
No
output
1
452
2
905
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vova plays a computer game known as Mages and Monsters. Vova's character is a mage. Though as he has just started, his character knows no spells. Vova's character can learn new spells during th...
instruction
0
453
2
906
No
output
1
453
2
907
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vova plays a computer game known as Mages and Monsters. Vova's character is a mage. Though as he has just started, his character knows no spells. Vova's character can learn new spells during th...
instruction
0
454
2
908
No
output
1
454
2
909
Provide a correct Python 3 solution for this coding contest problem. Brave Ponta and his best friend, Brave Gonta, have come to Luida's bar in search of friends to embark on an epic adventure. There are many warriors, monks and wizards in the tavern who are itching to go on an adventure. Gonta, who is kind-hearted, c...
instruction
0
730
2
1,460
"Correct Solution: ``` def main(): while True: n = int(input()) if n == 0: break alst = list(map(int, input().split())) s = sum(alst) alst = [a * 2 for a in alst] lst = [-s] for a in alst: lst.extend([i + a for i in lst]) print(min(map(abs, lst))) main() ```
output
1
730
2
1,461
Provide a correct Python 3 solution for this coding contest problem. Brave Ponta and his best friend, Brave Gonta, have come to Luida's bar in search of friends to embark on an epic adventure. There are many warriors, monks and wizards in the tavern who are itching to go on an adventure. Gonta, who is kind-hearted, c...
instruction
0
731
2
1,462
"Correct Solution: ``` while True: n = int(input()) if n == 0: break a = list(map(int, input().split())) b = sum(a) ans = b >> 1 if ans in a: print(b - 2*ans) continue c = [v for v in a if v < ans] s , f, q, qlen = set(), True, [0], 1 for v in c: i, k...
output
1
731
2
1,463
Provide a correct Python 3 solution for this coding contest problem. Brave Ponta and his best friend, Brave Gonta, have come to Luida's bar in search of friends to embark on an epic adventure. There are many warriors, monks and wizards in the tavern who are itching to go on an adventure. Gonta, who is kind-hearted, c...
instruction
0
732
2
1,464
"Correct Solution: ``` # AOJ 1045: Split Up! # Python3 2018.7.6 bal4u while True: n = int(input()) if n == 0: break t = list(map(int, input().split())) s = sum(t) ans = s >> 1 if ans in t: print(s - 2*ans) continue a = [v for v in t if v < ans] S, f, Q, qlen = set(), True, [0], 1 for v in a: i, k = 0, q...
output
1
732
2
1,465
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Brave Ponta and his best friend, Brave Gonta, have come to Luida's bar in search of friends to embark on an epic adventure. There are many warriors, monks and wizards in the tavern who are itchi...
instruction
0
733
2
1,466
No
output
1
733
2
1,467
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Brave Ponta and his best friend, Brave Gonta, have come to Luida's bar in search of friends to embark on an epic adventure. There are many warriors, monks and wizards in the tavern who are itchi...
instruction
0
734
2
1,468
No
output
1
734
2
1,469
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Brave Ponta and his best friend, Brave Gonta, have come to Luida's bar in search of friends to embark on an epic adventure. There are many warriors, monks and wizards in the tavern who are itchi...
instruction
0
735
2
1,470
No
output
1
735
2
1,471
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Brave Ponta and his best friend, Brave Gonta, have come to Luida's bar in search of friends to embark on an epic adventure. There are many warriors, monks and wizards in the tavern who are itchi...
instruction
0
736
2
1,472
No
output
1
736
2
1,473
Provide tags and a correct Python 3 solution for this coding contest problem. There is a colony of villains with several holes aligned in a row, where each hole contains exactly one villain. Each colony arrangement can be expressed as a string of even length, where the i-th character of the string represents the type...
instruction
0
847
2
1,694
Tags: combinatorics, dp, math Correct Solution: ``` from sys import stdin MOD = 1000000007 s = stdin.readline().strip() n = len(s) buc = [0] * 101 fac = [0] * (n + 1) inv = [0] * (n + 1) dp = [0] * (n + 1) # temp_dp = [0] * (n+1) ans = [[0] * 55 for _ in range(55)] def find(c: 'str') -> 'int': if 'A' <= c <= 'Z':...
output
1
847
2
1,695
Provide tags and a correct Python 3 solution for this coding contest problem. There is a colony of villains with several holes aligned in a row, where each hole contains exactly one villain. Each colony arrangement can be expressed as a string of even length, where the i-th character of the string represents the type...
instruction
0
848
2
1,696
Tags: combinatorics, dp, math Correct Solution: ``` from sys import stdin MOD = 1000000007 s = stdin.readline().strip() n = len(s) buc = [0] * 101 fac = [0] * (n + 1) inv = [0] * (n + 1) dp = [0] * (n + 1) # temp_dp = [0] * (n+1) ans = [[0] * 55 for _ in range(55)] def find(c: 'str') -> 'int': if 'A' <= c <= 'Z':...
output
1
848
2
1,697
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a colony of villains with several holes aligned in a row, where each hole contains exactly one villain. Each colony arrangement can be expressed as a string of even length, where the i...
instruction
0
849
2
1,698
No
output
1
849
2
1,699
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a colony of villains with several holes aligned in a row, where each hole contains exactly one villain. Each colony arrangement can be expressed as a string of even length, where the i...
instruction
0
850
2
1,700
No
output
1
850
2
1,701
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a colony of villains with several holes aligned in a row, where each hole contains exactly one villain. Each colony arrangement can be expressed as a string of even length, where the i...
instruction
0
851
2
1,702
No
output
1
851
2
1,703
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a colony of villains with several holes aligned in a row, where each hole contains exactly one villain. Each colony arrangement can be expressed as a string of even length, where the i...
instruction
0
852
2
1,704
No
output
1
852
2
1,705
Provide tags and a correct Python 3 solution for this coding contest problem. Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which demonstrated the fighting techniques and tactic...
instruction
0
1,051
2
2,102
Tags: constructive algorithms, greedy, implementation Correct Solution: ``` def voevoda(n, m): if n == 1: return m if n == 2: return (m - m % 4) + 2 * min(m % 4, 2) return (n * m + 1) // 2 N, M = sorted([int(i) for i in input().split()]) print(voevoda(N, M)) ```
output
1
1,051
2
2,103
Provide tags and a correct Python 3 solution for this coding contest problem. Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which demonstrated the fighting techniques and tactic...
instruction
0
1,052
2
2,104
Tags: constructive algorithms, greedy, implementation Correct Solution: ``` n,m=map(int,input().split()) if n>m:n,m=m,n if n==1:print(m) elif n==2:print((m//4)*4+min((m%4)*2,4)) else:print((n*m)-(n*m)//2) ```
output
1
1,052
2
2,105
Provide tags and a correct Python 3 solution for this coding contest problem. Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which demonstrated the fighting techniques and tactic...
instruction
0
1,053
2
2,106
Tags: constructive algorithms, greedy, implementation Correct Solution: ``` def li(): return list(map(int, input().split(" "))) n, m = li() if n < m: t =n n = m m = t if m == 1: print(n) elif m == 2: print(2*(2*(n//4) + min(n%4, 2))) else: print((n*m) - (n*m)//2) ```
output
1
1,053
2
2,107
Provide tags and a correct Python 3 solution for this coding contest problem. Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which demonstrated the fighting techniques and tactic...
instruction
0
1,054
2
2,108
Tags: constructive algorithms, greedy, implementation Correct Solution: ``` s=input().split() n=int(s[0]) m=int(s[1]) if (n>m): a=n n=m m=a if (n==1): print(m) elif (n==2): if (m%4<=2): print(m+m%4) else: print(m+1) else: print((n*m+1)//2) ```
output
1
1,054
2
2,109
Provide tags and a correct Python 3 solution for this coding contest problem. Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which demonstrated the fighting techniques and tactic...
instruction
0
1,055
2
2,110
Tags: constructive algorithms, greedy, implementation Correct Solution: ``` n, m = map(int, input().split()) if n > m: n, m = m, n if n > 2 and m > 2: print(((n * m) + 1) // 2) elif n == 1: print(m) else: print(2 * (((m // 4) * 2) + min(m % 4, 2))) # Made By Mostafa_Khaled ```
output
1
1,055
2
2,111
Provide tags and a correct Python 3 solution for this coding contest problem. Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which demonstrated the fighting techniques and tactic...
instruction
0
1,056
2
2,112
Tags: constructive algorithms, greedy, implementation Correct Solution: ``` n,m=sorted(list(map(int,input().split()))) if n==1: print(m) elif n==2: print(4*((n*m)//8)+min((n*m)%8,4)) else: print(n*m//2+n*m%2) ```
output
1
1,056
2
2,113
Provide tags and a correct Python 3 solution for this coding contest problem. Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which demonstrated the fighting techniques and tactic...
instruction
0
1,057
2
2,114
Tags: constructive algorithms, greedy, implementation Correct Solution: ``` n, m = sorted(map(int, input().split())) k = 4 * (m >> 2) print(m if n == 1 else k + 2 * min(2, m - k) if n == 2 else (m * n + 1 >> 1)) ```
output
1
1,057
2
2,115
Provide tags and a correct Python 3 solution for this coding contest problem. Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which demonstrated the fighting techniques and tactic...
instruction
0
1,058
2
2,116
Tags: constructive algorithms, greedy, implementation Correct Solution: ``` n, m = map(int, input().split()) if n > m: n, m = m, n if n > 2 and m > 2: print(((n * m) + 1) // 2) elif n == 1: print(m) else: print(2 * (((m // 4) * 2) + min(m % 4, 2))) ```
output
1
1,058
2
2,117
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which ...
instruction
0
1,059
2
2,118
No
output
1
1,059
2
2,119
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which ...
instruction
0
1,060
2
2,120
No
output
1
1,060
2
2,121
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which ...
instruction
0
1,061
2
2,122
No
output
1
1,061
2
2,123
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which ...
instruction
0
1,062
2
2,124
No
output
1
1,062
2
2,125
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Priests of the Quetzalcoatl cult want to build a tower to represent a power of their god. Tower is usually made of power-charged rocks. It is built with the help of rare magic by levitating the ...
instruction
0
1,408
2
2,816
No
output
1
1,408
2
2,817
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Priests of the Quetzalcoatl cult want to build a tower to represent a power of their god. Tower is usually made of power-charged rocks. It is built with the help of rare magic by levitating the ...
instruction
0
1,409
2
2,818
No
output
1
1,409
2
2,819
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Priests of the Quetzalcoatl cult want to build a tower to represent a power of their god. Tower is usually made of power-charged rocks. It is built with the help of rare magic by levitating the ...
instruction
0
1,410
2
2,820
No
output
1
1,410
2
2,821
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Priests of the Quetzalcoatl cult want to build a tower to represent a power of their god. Tower is usually made of power-charged rocks. It is built with the help of rare magic by levitating the ...
instruction
0
1,411
2
2,822
No
output
1
1,411
2
2,823
Provide tags and a correct Python 3 solution for this coding contest problem. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a magic integer on it. The translation from Old Bea...
instruction
0
1,922
2
3,844
Tags: dp Correct Solution: ``` # n = 24 def get_subs(n): count = 0 while n != '0': digits = [int(i) for i in n] max_digit = max(digits) n = int(n) - max_digit n = str(n) count += 1 return count if __name__ == '__main__': n = input() print(get_subs(n)) ...
output
1
1,922
2
3,845
Provide tags and a correct Python 3 solution for this coding contest problem. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a magic integer on it. The translation from Old Bea...
instruction
0
1,923
2
3,846
Tags: dp Correct Solution: ``` t = int(input()) c = 0 while t!=0: c+=1 t = t-int(max(str(t))) print(c) ```
output
1
1,923
2
3,847
Provide tags and a correct Python 3 solution for this coding contest problem. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a magic integer on it. The translation from Old Bea...
instruction
0
1,924
2
3,848
Tags: dp Correct Solution: ``` n = int(input()) count = 0 while n: maxi = 0 nn = n while nn: maxi = max(maxi, nn%10) nn //= 10 count += 1 n -= maxi print(count) ```
output
1
1,924
2
3,849
Provide tags and a correct Python 3 solution for this coding contest problem. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a magic integer on it. The translation from Old Bea...
instruction
0
1,925
2
3,850
Tags: dp Correct Solution: ``` import math from math import gcd,floor,sqrt,log def iin(): return int(input()) def sin(): return input().strip() def listin(): return list(map(int,input().strip().split())) def liststr(): return list(map(str,input().strip().split())) def ceill(x): return int(x) if(x==int(x)) else int(x)...
output
1
1,925
2
3,851
Provide tags and a correct Python 3 solution for this coding contest problem. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a magic integer on it. The translation from Old Bea...
instruction
0
1,926
2
3,852
Tags: dp Correct Solution: ``` import math import sys input = sys.stdin.readline n = int(input()) opt = 0 while n != 0: n -= int(max(list(str(n)))) opt += 1 print(opt) ```
output
1
1,926
2
3,853
Provide tags and a correct Python 3 solution for this coding contest problem. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a magic integer on it. The translation from Old Bea...
instruction
0
1,927
2
3,854
Tags: dp Correct Solution: ``` n = int(input()) f = n s = 1 while n > 9: n -= max(map(int, str(n))) s += 1 if f == 0: print(0) else: print(s) ```
output
1
1,927
2
3,855
Provide tags and a correct Python 3 solution for this coding contest problem. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a magic integer on it. The translation from Old Bea...
instruction
0
1,928
2
3,856
Tags: dp Correct Solution: ``` from sys import stdin,stdout from math import gcd,sqrt,factorial,inf from collections import deque,defaultdict input=stdin.readline R=lambda:map(int,input().split()) I=lambda:int(input()) S=lambda:input().rstrip('\n') L=lambda:list(R()) P=lambda x:stdout.write(x) lcm=lambda x,y:(x*y)//gcd...
output
1
1,928
2
3,857
Provide tags and a correct Python 3 solution for this coding contest problem. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a magic integer on it. The translation from Old Bea...
instruction
0
1,929
2
3,858
Tags: dp Correct Solution: ``` n = int(input()) k = 0 m = 0 while int(n) != 0: m = int(max(str(n))) n -= m k += 1 print(k) ```
output
1
1,929
2
3,859
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a ma...
instruction
0
1,930
2
3,860
Yes
output
1
1,930
2
3,861
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a ma...
instruction
0
1,931
2
3,862
Yes
output
1
1,931
2
3,863
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a ma...
instruction
0
1,932
2
3,864
Yes
output
1
1,932
2
3,865
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a ma...
instruction
0
1,933
2
3,866
Yes
output
1
1,933
2
3,867
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a ma...
instruction
0
1,934
2
3,868
No
output
1
1,934
2
3,869
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a ma...
instruction
0
1,935
2
3,870
No
output
1
1,935
2
3,871
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a ma...
instruction
0
1,936
2
3,872
No
output
1
1,936
2
3,873
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, an archaeologist, got a sacred plate with a ma...
instruction
0
1,937
2
3,874
No
output
1
1,937
2
3,875
End of preview. Expand in Data Studio

Dataset Card for "python3-standardized_cluster_2_std"

More Information needed

Downloads last month
8