message stringlengths 2 20.1k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 1.95k 109k | cluster float64 17 17 | __index_level_0__ int64 3.91k 217k |
|---|---|---|---|---|---|
Provide a correct Python 3 solution for this coding contest problem.
I have a plan to go on a school trip at a school. I conducted a questionnaire survey for that purpose. Students have student numbers from 1 to n, and the locations of travel candidates are represented by numbers from 1 to m, and where they want to go... | instruction | 0 | 40,368 | 17 | 80,736 |
"Correct Solution:
```
def main():
while True:
n, m = map(int,input().split())
if not n:
break
lst = [0] * m
for i in range(n):
lst = [i + j for i, j in zip(lst, map(int,input().split()))]
lst = list(zip(lst,range(1,m + 1)))
lst = sorted(lst,key=lambda t:-t[0])
... | output | 1 | 40,368 | 17 | 80,737 |
Provide a correct Python 3 solution for this coding contest problem.
I have a plan to go on a school trip at a school. I conducted a questionnaire survey for that purpose. Students have student numbers from 1 to n, and the locations of travel candidates are represented by numbers from 1 to m, and where they want to go... | instruction | 0 | 40,369 | 17 | 80,738 |
"Correct Solution:
```
#!/usr/bin/env python3
while True:
n,m = map(int,input().split())
if n == 0 and m == 0:
break
sum = []
for i in range(m):
sum.append(0)
smax = 0
for i in range(n):
ans = list(map(int,input().split()))
for i in range(m):
if ans[i] == 1:
sum[i] += 1
if smax < sum[i]:
... | output | 1 | 40,369 | 17 | 80,739 |
Provide a correct Python 3 solution for this coding contest problem.
I have a plan to go on a school trip at a school. I conducted a questionnaire survey for that purpose. Students have student numbers from 1 to n, and the locations of travel candidates are represented by numbers from 1 to m, and where they want to go... | instruction | 0 | 40,370 | 17 | 80,740 |
"Correct Solution:
```
while True :
n, m = map(int, input().split())
if n == 0 and m == 0 :
break
ans = [0] * m
for i in range(n) :
tmp = list(map(int, input().split()))
for j in range(m) :
ans[j] += tmp[j]
sort_ans = sorted(ans, reverse=True)
index_... | output | 1 | 40,370 | 17 | 80,741 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
I have a plan to go on a school trip at a school. I conducted a questionnaire survey for that purpose. Students have student numbers from 1 to n, and the locations of travel candidates are repre... | instruction | 0 | 40,371 | 17 | 80,742 |
Yes | output | 1 | 40,371 | 17 | 80,743 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
I have a plan to go on a school trip at a school. I conducted a questionnaire survey for that purpose. Students have student numbers from 1 to n, and the locations of travel candidates are repre... | instruction | 0 | 40,372 | 17 | 80,744 |
Yes | output | 1 | 40,372 | 17 | 80,745 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
I have a plan to go on a school trip at a school. I conducted a questionnaire survey for that purpose. Students have student numbers from 1 to n, and the locations of travel candidates are repre... | instruction | 0 | 40,373 | 17 | 80,746 |
Yes | output | 1 | 40,373 | 17 | 80,747 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
I have a plan to go on a school trip at a school. I conducted a questionnaire survey for that purpose. Students have student numbers from 1 to n, and the locations of travel candidates are repre... | instruction | 0 | 40,374 | 17 | 80,748 |
Yes | output | 1 | 40,374 | 17 | 80,749 |
Provide a correct Python 3 solution for this coding contest problem.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is a sequence of records of program submission in the order... | instruction | 0 | 40,375 | 17 | 80,750 |
"Correct Solution:
```
# coding: utf-8
while 1:
m,t,p,r=map(int,input().split())
if m==0:
break
teamdata=[[0,0,i+1,set()] for i in range(t)]
data=[]
for i in range(r):
a,b,c,d=map(int,input().split())
if d==0:
teamdata[b-1][0]+=1
teamdata[b-1][1]+=a
... | output | 1 | 40,375 | 17 | 80,751 |
Provide a correct Python 3 solution for this coding contest problem.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is a sequence of records of program submission in the order... | instruction | 0 | 40,376 | 17 | 80,752 |
"Correct Solution:
```
while 1:
M,T,P,R=map(int,input().split())
if not M and not T and not P and not R:break
d={i:[0,0] for i in range(1,T+1)}
wa=[[0 for _ in range(P)] for _ in range(T)]
for _ in range(R):
m,t,p,j=map(int,input().split())
if j:
wa[t-1][p-1]+=20
... | output | 1 | 40,376 | 17 | 80,753 |
Provide a correct Python 3 solution for this coding contest problem.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is a sequence of records of program submission in the order... | instruction | 0 | 40,377 | 17 | 80,754 |
"Correct Solution:
```
ans_list = []
while True:
m, t, p, r = map(int, input().split())
if m == 0 and t == 0 and r == 0 and p == 0:
break
team = [[[0, 1] for i in range(p)] for j in range(t)]
for i in range(r):
M, T, P, J = map(int, input().split())
if J:
team[T - ... | output | 1 | 40,377 | 17 | 80,755 |
Provide a correct Python 3 solution for this coding contest problem.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is a sequence of records of program submission in the order... | instruction | 0 | 40,378 | 17 | 80,756 |
"Correct Solution:
```
def main():
while True:
# minute,team,problem,record
M,T,P,R = map(int, input().split(" "))
if M == 0: break
# [チーム1→[問題1,問題2...],チーム2→[...]...]
data = [[0 for i in range(P)] for j in range(T)]
# [正答数,所要合計時間]
res = [[0, 0] for j in rang... | output | 1 | 40,378 | 17 | 80,757 |
Provide a correct Python 3 solution for this coding contest problem.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is a sequence of records of program submission in the order... | instruction | 0 | 40,379 | 17 | 80,758 |
"Correct Solution:
```
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1187&lang=jp
"""
import sys
from sys import stdin
input = stdin.readline
class Team(object):
def __init__(self, id):
self.id = id
self.correct = 0 # ??£?§£??°
self.time = 0 ... | output | 1 | 40,379 | 17 | 80,759 |
Provide a correct Python 3 solution for this coding contest problem.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is a sequence of records of program submission in the order... | instruction | 0 | 40,380 | 17 | 80,760 |
"Correct Solution:
```
while True:
M, T, P, R = map(int, input().split())
if M == 0: break
teams = [[0, 0, i+1] for i in range(T)]
miss = [[0 for _ in range(P)] for _ in range(T)]
solved, time = 0, 1
logs = [map(int, input().split()) for _ in range(R)]
for m, t, p, r in logs:
t -= 1
... | output | 1 | 40,380 | 17 | 80,761 |
Provide a correct Python 3 solution for this coding contest problem.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is a sequence of records of program submission in the order... | instruction | 0 | 40,381 | 17 | 80,762 |
"Correct Solution:
```
while True:
M, T, P, R = map(int, input().split())
if M == T == P == R == 0:
quit()
a_list = [[0, 0, i] for i in range(T)]
wa = [[0 for j in range(P)] for i in range(T)]
for i in range(R):
m, t, p, j = map(int, input().split())
t -= 1
p -= 1
... | output | 1 | 40,381 | 17 | 80,763 |
Provide a correct Python 3 solution for this coding contest problem.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is a sequence of records of program submission in the order... | instruction | 0 | 40,382 | 17 | 80,764 |
"Correct Solution:
```
def main(M, T, P, R):
team = [[0, 0, i + 1] for i in range(T)]
teamprob = [[0] * P for i in range(T)]
for _ in range(R):
m, t, p, r = map(int, input().split())
if r == 0:
team[t - 1][0] += 1
team[t - 1][1] -= m
team[t - 1][1] -= team... | output | 1 | 40,382 | 17 | 80,765 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is ... | instruction | 0 | 40,383 | 17 | 80,766 |
Yes | output | 1 | 40,383 | 17 | 80,767 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is ... | instruction | 0 | 40,384 | 17 | 80,768 |
Yes | output | 1 | 40,384 | 17 | 80,769 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is ... | instruction | 0 | 40,385 | 17 | 80,770 |
Yes | output | 1 | 40,385 | 17 | 80,771 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is ... | instruction | 0 | 40,386 | 17 | 80,772 |
Yes | output | 1 | 40,386 | 17 | 80,773 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is ... | instruction | 0 | 40,387 | 17 | 80,774 |
No | output | 1 | 40,387 | 17 | 80,775 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is ... | instruction | 0 | 40,388 | 17 | 80,776 |
No | output | 1 | 40,388 | 17 | 80,777 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is ... | instruction | 0 | 40,389 | 17 | 80,778 |
No | output | 1 | 40,389 | 17 | 80,779 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
ICPC Ranking
Your mission in this problem is to write a program which, given the submission log of an ICPC (International Collegiate Programming Contest), determines team rankings.
The log is ... | instruction | 0 | 40,390 | 17 | 80,780 |
No | output | 1 | 40,390 | 17 | 80,781 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n students at Berland State University. Every student has two skills, each measured as a number: ai — the programming skill and bi — the sports skill.
It is announced that an Olympiad in programming and sports will be held soon. T... | instruction | 0 | 40,871 | 17 | 81,742 |
Tags: dp, flows, graphs, greedy
Correct Solution:
```
#!/usr/bin/env python3
from itertools import accumulate
from heapq import heappop, heappush
def top(ppl_indices, vals, start):
Q = []
res = [0 for i in range(len(ppl_indices))]
for k, idx in enumerate(ppl_indices):
heappush(Q, -vals[idx])
... | output | 1 | 40,871 | 17 | 81,743 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n students at Berland State University. Every student has two skills, each measured as a number: ai — the programming skill and bi — the sports skill.
It is announced that an Olympiad... | instruction | 0 | 40,872 | 17 | 81,744 |
No | output | 1 | 40,872 | 17 | 81,745 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n students at Berland State University. Every student has two skills, each measured as a number: ai — the programming skill and bi — the sports skill.
It is announced that an Olympiad... | instruction | 0 | 40,873 | 17 | 81,746 |
No | output | 1 | 40,873 | 17 | 81,747 |
Provide a correct Python 3 solution for this coding contest problem.
Entrance Examination
The International Competitive Programming College (ICPC) is famous for its research on competitive programming. Applicants to the college are required to take its entrance examination.
The successful applicants of the examinati... | instruction | 0 | 41,149 | 17 | 82,298 |
"Correct Solution:
```
while True:
m,nmin,nmax = [int(x) for x in input().split()]
if m == nmin == nmax == 0:
break
a = [0]
for i in range(m):
a.append(int(input()))
ans = 0
ans_index = nmin
for n in range(nmin,nmax+1):
if ans <= a[n]-a[n+1]:
ans = a[n]-... | output | 1 | 41,149 | 17 | 82,299 |
Provide a correct Python 3 solution for this coding contest problem.
Entrance Examination
The International Competitive Programming College (ICPC) is famous for its research on competitive programming. Applicants to the college are required to take its entrance examination.
The successful applicants of the examinati... | instruction | 0 | 41,150 | 17 | 82,300 |
"Correct Solution:
```
while True:
m,mn,mx = map(int,input().split())
if m==0: break
l = [int(input()) for _ in range(m)]
r = []
for i in range(mn,mx+1):
r += [l[i-1]-l[i]]
print(max([i+mn for i,x in enumerate(r) if x==max(r)]))
``` | output | 1 | 41,150 | 17 | 82,301 |
Provide a correct Python 3 solution for this coding contest problem.
Entrance Examination
The International Competitive Programming College (ICPC) is famous for its research on competitive programming. Applicants to the college are required to take its entrance examination.
The successful applicants of the examinati... | instruction | 0 | 41,151 | 17 | 82,302 |
"Correct Solution:
```
while True:
n,big,small = map(int,input().split(" "))
if n == 0:
break
points = []
for i in range(n):
points.append(int(input()))
results = []
for i in range(big,small+1):
results.append(points[i-1] - points[i])
ameba = len(results)
for i ... | output | 1 | 41,151 | 17 | 82,303 |
Provide a correct Python 3 solution for this coding contest problem.
Entrance Examination
The International Competitive Programming College (ICPC) is famous for its research on competitive programming. Applicants to the college are required to take its entrance examination.
The successful applicants of the examinati... | instruction | 0 | 41,152 | 17 | 82,304 |
"Correct Solution:
```
while True:
m, nl, nu = map(int, input().split())
if m == 0:
break
p = [int(input()) for i in range(m)]
gap = ans = 0
for n in range(nl, nu + 1):
if p[n - 1] - p[n] >= gap:
gap = p[n - 1] - p[n]
ans = n
print(ans)
``` | output | 1 | 41,152 | 17 | 82,305 |
Provide a correct Python 3 solution for this coding contest problem.
Entrance Examination
The International Competitive Programming College (ICPC) is famous for its research on competitive programming. Applicants to the college are required to take its entrance examination.
The successful applicants of the examinati... | instruction | 0 | 41,153 | 17 | 82,306 |
"Correct Solution:
```
while True :
m, n, N = map(int, input().split())
if(m == 0 and n == 0 and N == 0) :
break
else :
p = [0] * m
for i in range(m) :
p[i] = int(input())
s = 0
for j in range(n - 1, N) :
if(p[j] - p[j + 1] >= s) :
s = p[j] - p[j + 1]
a = j + 1
... | output | 1 | 41,153 | 17 | 82,307 |
Provide a correct Python 3 solution for this coding contest problem.
Entrance Examination
The International Competitive Programming College (ICPC) is famous for its research on competitive programming. Applicants to the college are required to take its entrance examination.
The successful applicants of the examinati... | instruction | 0 | 41,154 | 17 | 82,308 |
"Correct Solution:
```
def solve():
m, mn, mx = map(int, input().split())
if m == 0 and mn == 0 and mx == 0:
return False
p = [int(input()) for x in range(m)]
result, ans = 0, 0
for i in range(mn, mx + 1):
if p[i - 1] - p[i] >= result:
result = p[i - 1] - p[i]
... | output | 1 | 41,154 | 17 | 82,309 |
Provide a correct Python 3 solution for this coding contest problem.
Entrance Examination
The International Competitive Programming College (ICPC) is famous for its research on competitive programming. Applicants to the college are required to take its entrance examination.
The successful applicants of the examinati... | instruction | 0 | 41,155 | 17 | 82,310 |
"Correct Solution:
```
for v in range(1000):
s,t,u = input().split()
s = int(s)
t = int(t)
u = int(u)
if s == 0:
break
else:
l = []
m = []
for i in range(s):
l.append(int(input()))
for o in range(s-1):
w = l[o]-l[o+1]
w = abs(w)
m.append(w)
m = m[t-1:u]
... | output | 1 | 41,155 | 17 | 82,311 |
Provide a correct Python 3 solution for this coding contest problem.
Entrance Examination
The International Competitive Programming College (ICPC) is famous for its research on competitive programming. Applicants to the college are required to take its entrance examination.
The successful applicants of the examinati... | instruction | 0 | 41,156 | 17 | 82,312 |
"Correct Solution:
```
def main():
while True:
m, nmin, nmax = [int(s) for s in input().strip().split(' ')]
if m == 0:
break
plist = sorted((int(input().strip()) for _ in range(m)), reverse=True)
ni = 0
gap = 0
for i in range(nmin-1, nmax):
ng... | output | 1 | 41,156 | 17 | 82,313 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A team of students from the city S is sent to the All-Berland Olympiad in Informatics. Traditionally, they go on the train. All students have bought tickets in one carriage, consisting of n comp... | instruction | 0 | 41,550 | 17 | 83,100 |
No | output | 1 | 41,550 | 17 | 83,101 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A team of students from the city S is sent to the All-Berland Olympiad in Informatics. Traditionally, they go on the train. All students have bought tickets in one carriage, consisting of n comp... | instruction | 0 | 41,552 | 17 | 83,104 |
No | output | 1 | 41,552 | 17 | 83,105 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n student groups at the university. During the study day, each group can take no more than 7 classes. Seven time slots numbered from 1 to 7 are allocated for the classes.
The schedule... | instruction | 0 | 41,762 | 17 | 83,524 |
Yes | output | 1 | 41,762 | 17 | 83,525 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n student groups at the university. During the study day, each group can take no more than 7 classes. Seven time slots numbered from 1 to 7 are allocated for the classes.
The schedule... | instruction | 0 | 41,764 | 17 | 83,528 |
No | output | 1 | 41,764 | 17 | 83,529 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n student groups at the university. During the study day, each group can take no more than 7 classes. Seven time slots numbered from 1 to 7 are allocated for the classes.
The schedule... | instruction | 0 | 41,765 | 17 | 83,530 |
No | output | 1 | 41,765 | 17 | 83,531 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n student groups at the university. During the study day, each group can take no more than 7 classes. Seven time slots numbered from 1 to 7 are allocated for the classes.
The schedule... | instruction | 0 | 41,766 | 17 | 83,532 |
No | output | 1 | 41,766 | 17 | 83,533 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n student groups at the university. During the study day, each group can take no more than 7 classes. Seven time slots numbered from 1 to 7 are allocated for the classes.
The schedule... | instruction | 0 | 41,767 | 17 | 83,534 |
No | output | 1 | 41,767 | 17 | 83,535 |
Provide a correct Python 3 solution for this coding contest problem.
Look for the Winner!
The citizens of TKB City are famous for their deep love in elections and vote counting. Today they hold an election for the next chairperson of the electoral commission. Now the voting has just been closed and the counting is go... | instruction | 0 | 42,021 | 17 | 84,042 |
"Correct Solution:
```
from collections import defaultdict
# -*- coding: utf-8 -*-
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
def solve():
N = int(input())
if N == 0:
exit()
votes = input().split()
remain = N
d = dict()
for a in '... | output | 1 | 42,021 | 17 | 84,043 |
Provide a correct Python 3 solution for this coding contest problem.
Look for the Winner!
The citizens of TKB City are famous for their deep love in elections and vote counting. Today they hold an election for the next chairperson of the electoral commission. Now the voting has just been closed and the counting is go... | instruction | 0 | 42,022 | 17 | 84,044 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(10**6)
def main():
n = int(input())
if n == 0:
return
c = [ord(i)-65 for i in input().split(" ")]
getnum = [0 for i in range(30)]
mnum = 29
snum = 29
flg = True
for i in range(n):
getnum[c[i]] += 1
if getnum[c[i]] >= getnum[mnum] and mnum != c[i]:
... | output | 1 | 42,022 | 17 | 84,045 |
Provide a correct Python 3 solution for this coding contest problem.
Look for the Winner!
The citizens of TKB City are famous for their deep love in elections and vote counting. Today they hold an election for the next chairperson of the electoral commission. Now the voting has just been closed and the counting is go... | instruction | 0 | 42,023 | 17 | 84,046 |
"Correct Solution:
```
while True:
n = int(input())
if n == 0:
break
c = list(input().split())
hyou = [0] * 26
isTie = True
for i in range(0,n):
hyou[ord(c[i]) - ord('A')] += 1
ma1,ma2 = 0,0
mai1,mai2 = 0,0
for j in range(0,26):
if ma2 < hyou[j... | output | 1 | 42,023 | 17 | 84,047 |
Provide a correct Python 3 solution for this coding contest problem.
Look for the Winner!
The citizens of TKB City are famous for their deep love in elections and vote counting. Today they hold an election for the next chairperson of the electoral commission. Now the voting has just been closed and the counting is go... | instruction | 0 | 42,024 | 17 | 84,048 |
"Correct Solution:
```
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1
while True:
n = int(input())
if n==0:break
A = input().split()
data = [0]... | output | 1 | 42,024 | 17 | 84,049 |
Provide a correct Python 3 solution for this coding contest problem.
Look for the Winner!
The citizens of TKB City are famous for their deep love in elections and vote counting. Today they hold an election for the next chairperson of the electoral commission. Now the voting has just been closed and the counting is go... | instruction | 0 | 42,025 | 17 | 84,050 |
"Correct Solution:
```
#!/usr/bin/env python3
from collections import Counter
while True:
n = int(input())
if n == 0:
break
c = input().split()
cnt = Counter()
for i, x in enumerate(c):
cnt[x] += 1
m1 = ('', 0)
m2 = ('', 0)
for k, v in cnt.items():
... | output | 1 | 42,025 | 17 | 84,051 |
Provide a correct Python 3 solution for this coding contest problem.
Look for the Winner!
The citizens of TKB City are famous for their deep love in elections and vote counting. Today they hold an election for the next chairperson of the electoral commission. Now the voting has just been closed and the counting is go... | instruction | 0 | 42,026 | 17 | 84,052 |
"Correct Solution:
```
from collections import Counter
while 334:
N=int(input())
if N==0:break
Hyoes = input().split()
C=dict([])
for t in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
C[t]=0
curtop=["A",0]
for hyo,c in enumerate(Hyoes,1):
C[c] += 1
if C[c]>curtop[1]:
cur... | output | 1 | 42,026 | 17 | 84,053 |
Provide a correct Python 3 solution for this coding contest problem.
Look for the Winner!
The citizens of TKB City are famous for their deep love in elections and vote counting. Today they hold an election for the next chairperson of the electoral commission. Now the voting has just been closed and the counting is go... | instruction | 0 | 42,027 | 17 | 84,054 |
"Correct Solution:
```
import sys
from inspect import currentframe
def pri(*args):
names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}
print(', '.join(names.get(id(arg), '???')+' = '+repr(arg) for arg in args))
def solve(n, c):
flat = ord("A")
vote_count = [[i, 0] for i in range(... | output | 1 | 42,027 | 17 | 84,055 |
Provide a correct Python 3 solution for this coding contest problem.
Look for the Winner!
The citizens of TKB City are famous for their deep love in elections and vote counting. Today they hold an election for the next chairperson of the electoral commission. Now the voting has just been closed and the counting is go... | instruction | 0 | 42,028 | 17 | 84,056 |
"Correct Solution:
```
while 1:
n=int(input())
if not n:break
vote={"":0}
cnt=0
for c in input().split(" "):
cnt+=1
if c in vote:vote[c]+=1
else:vote[c]=1
v=sorted(vote.items(), key=lambda x: x[1])
if v[-1][-1]>v[-2][-1]... | output | 1 | 42,028 | 17 | 84,057 |
Provide a correct Python 3 solution for this coding contest problem.
The University of Aizu Elementary School (Aizu University and Small) is famous as one of Japan's leading competition programmer training schools. Of course, it is essential to practice the algorithm even when attending an athletic meet. Of course you... | instruction | 0 | 42,036 | 17 | 84,072 |
"Correct Solution:
```
from heapq import heappush, heappop, heapify
import sys
readline = sys.stdin.readline
write = sys.stdout.write
def solve():
N, M, K = map(int, readline().split())
INF = 10**18
E = [[-INF]*N for i in range(N)]
for i in range(M):
a, b, c = map(int, readline().split())
... | output | 1 | 42,036 | 17 | 84,073 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.