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 tags and a correct Python 3 solution for this coding contest problem.
You still have partial information about the score during the historic football match. You are given a set of pairs (a_i, b_i), indicating that at some point during the match the score was "a_i: b_i". It is known that if the current score is... | instruction | 0 | 64,022 | 17 | 128,044 |
Tags: greedy, implementation
Correct Solution:
```
xi = 0
yi = 0
ans = 1
for i in range (int(input())) :
xf,yf = map(int,input().split())
if xi == yi :
ans = ans + min (yf - yi , xf - xi)
else :
m1 = max (xi,yi)
m2 = min (xf,yf)
t = max(m2-m1+1,0)
#print("sdds",t)
... | output | 1 | 64,022 | 17 | 128,045 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You still have partial information about the score during the historic football match. You are given a set of pairs (a_i, b_i), indicating that at some point during the match the score was "a_i: b_i". It is known that if the current score is... | instruction | 0 | 64,023 | 17 | 128,046 |
Tags: greedy, implementation
Correct Solution:
```
q = int(input())
a , b = 0,0
draws =1
for _ in range(q):
c , d = map(int, input().split())
draws+= max(0 , min(c,d)-max(a,b)+(a!=b) )
a , b = c, d
print(draws)
``` | output | 1 | 64,023 | 17 | 128,047 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You still have partial information about the score during the historic football match. You are given a set of pairs (a_i, b_i), indicating that at some point during the match the score was "a_i:... | instruction | 0 | 64,024 | 17 | 128,048 |
Yes | output | 1 | 64,024 | 17 | 128,049 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You still have partial information about the score during the historic football match. You are given a set of pairs (a_i, b_i), indicating that at some point during the match the score was "a_i:... | instruction | 0 | 64,025 | 17 | 128,050 |
Yes | output | 1 | 64,025 | 17 | 128,051 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You still have partial information about the score during the historic football match. You are given a set of pairs (a_i, b_i), indicating that at some point during the match the score was "a_i:... | instruction | 0 | 64,026 | 17 | 128,052 |
Yes | output | 1 | 64,026 | 17 | 128,053 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You still have partial information about the score during the historic football match. You are given a set of pairs (a_i, b_i), indicating that at some point during the match the score was "a_i:... | instruction | 0 | 64,027 | 17 | 128,054 |
Yes | output | 1 | 64,027 | 17 | 128,055 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You still have partial information about the score during the historic football match. You are given a set of pairs (a_i, b_i), indicating that at some point during the match the score was "a_i:... | instruction | 0 | 64,028 | 17 | 128,056 |
No | output | 1 | 64,028 | 17 | 128,057 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You still have partial information about the score during the historic football match. You are given a set of pairs (a_i, b_i), indicating that at some point during the match the score was "a_i:... | instruction | 0 | 64,029 | 17 | 128,058 |
No | output | 1 | 64,029 | 17 | 128,059 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You still have partial information about the score during the historic football match. You are given a set of pairs (a_i, b_i), indicating that at some point during the match the score was "a_i:... | instruction | 0 | 64,030 | 17 | 128,060 |
No | output | 1 | 64,030 | 17 | 128,061 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You still have partial information about the score during the historic football match. You are given a set of pairs (a_i, b_i), indicating that at some point during the match the score was "a_i:... | instruction | 0 | 64,031 | 17 | 128,062 |
No | output | 1 | 64,031 | 17 | 128,063 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Sereja is a coder and he likes to take part in Codesorfes rounds. However, Uzhland doesn't have good internet connection, so Sereja sometimes skips rounds.
Codesorfes has rounds of two types: Div1 (for advanced coders) and Div2 (for beginne... | instruction | 0 | 64,339 | 17 | 128,678 |
Tags: greedy, implementation, math
Correct Solution:
```
x, k = [int(i) for i in input().split()]
missed = [0] * x
for i in range(k):
divs = [int(i) for i in input().split()]
if divs[0] == 1:
missed[divs[1]] = 1
missed[divs[2]] = 1
else:
missed[divs[1]] = 1
max_answer = missed.coun... | output | 1 | 64,339 | 17 | 128,679 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Sereja is a coder and he likes to take part in Codesorfes rounds. However, Uzhland doesn't have good internet connection, so Sereja sometimes skips rounds.
Codesorfes has rounds of two types: Div1 (for advanced coders) and Div2 (for beginne... | instruction | 0 | 64,340 | 17 | 128,680 |
Tags: greedy, implementation, math
Correct Solution:
```
n,k=map(int,input().split())
rounds=[]
rounds.append(0)
rounds.append(n)
for i in range(k):
arr=[int(i) for i in input().split()]
if arr[0]==1:
rounds.append(arr[1])
rounds.append(arr[2])
else:
rounds.append(arr[1])
rounds.sort... | output | 1 | 64,340 | 17 | 128,681 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Sereja is a coder and he likes to take part in Codesorfes rounds. However, Uzhland doesn't have good internet connection, so Sereja sometimes skips rounds.
Codesorfes has rounds of two types: Div1 (for advanced coders) and Div2 (for beginne... | instruction | 0 | 64,341 | 17 | 128,682 |
Tags: greedy, implementation, math
Correct Solution:
```
n, q = map(int, input().split())
v = [0] * (n-1)
for i in range(q):
li = [int(i) for i in input().split()]
v[li[1]-1] = 2
if li[0] == 1:
v[li[2]-1] = 1
ma = v.count(0)
mi = 0
for i in range(n-1):
if v[i] == 0:
v[i] = 2
... | output | 1 | 64,341 | 17 | 128,683 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Sereja is a coder and he likes to take part in Codesorfes rounds. However, Uzhland doesn't have good internet connection, so Sereja sometimes skips rounds.
Codesorfes has rounds of two types: Div1 (for advanced coders) and Div2 (for beginne... | instruction | 0 | 64,342 | 17 | 128,684 |
Tags: greedy, implementation, math
Correct Solution:
```
#!/usr/bin/env python3
def main():
x, t = map(int, input().split())
markers = [1] * (x - 1)
for c in range(t):
r = [int(n) for n in input().split()]
markers[r[1] - 1] = 0
if r[0] == 1:
markers[r[2] - 1] = 0
c ... | output | 1 | 64,342 | 17 | 128,685 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Sereja is a coder and he likes to take part in Codesorfes rounds. However, Uzhland doesn't have good internet connection, so Sereja sometimes skips rounds.
Codesorfes has rounds of two types: Div1 (for advanced coders) and Div2 (for beginne... | instruction | 0 | 64,343 | 17 | 128,686 |
Tags: greedy, implementation, math
Correct Solution:
```
#!/usr/bin/python -SOO
x,n = map(int,input().strip().split())
s = set(range(1,x))
for _ in range(n):
xs = list(map(int,input().strip().split()))
if xs[0] == 2:
s.remove(xs[1])
else:
s.remove(xs[1])
s.remove(xs[2])
m,i= 0,0
s = ... | output | 1 | 64,343 | 17 | 128,687 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Sereja is a coder and he likes to take part in Codesorfes rounds. However, Uzhland doesn't have good internet connection, so Sereja sometimes skips rounds.
Codesorfes has rounds of two types: Div1 (for advanced coders) and Div2 (for beginne... | instruction | 0 | 64,344 | 17 | 128,688 |
Tags: greedy, implementation, math
Correct Solution:
```
x,k=map(int,input().split())
s=set()
for i in range(k):
a=list(map(int,input().split()))
if a[0]==1:
s.add(a[1])
s.add(a[2])
else:
s.add(a[1])
smax=set()
smin=set()
for i in range(1,x):
if not i in s and not i+1 in s and no... | output | 1 | 64,344 | 17 | 128,689 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Sereja is a coder and he likes to take part in Codesorfes rounds. However, Uzhland doesn't have good internet connection, so Sereja sometimes skips rounds.
Codesorfes has rounds of two types: Div1 (for advanced coders) and Div2 (for beginne... | instruction | 0 | 64,345 | 17 | 128,690 |
Tags: greedy, implementation, math
Correct Solution:
```
x,k=map(int,input().split(" "))
hs=[0]*4001
hs[x]=1
for i in range(k):
li=list(map(int,input().split(" ")))
hs[li[1]]=1
if li[0]==1:
hs[li[2]]=1
mx=0
for i in range(1,x):
if hs[i]==0:
mx+=1
mi=mx
i=2
while i<x:
if hs[i]==0 and ... | output | 1 | 64,345 | 17 | 128,691 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Sereja is a coder and he likes to take part in Codesorfes rounds. However, Uzhland doesn't have good internet connection, so Sereja sometimes skips rounds.
Codesorfes has rounds of two types: Div1 (for advanced coders) and Div2 (for beginne... | instruction | 0 | 64,346 | 17 | 128,692 |
Tags: greedy, implementation, math
Correct Solution:
```
import sys
f = sys.stdin
# f = open("input.txt", "r")
x, k = map(int, f.readline().strip().split())
a = []
for i in range(k):
a += list(map(int, f.readline().strip().split()))[1:]
a.sort()
sub = list(set(range(1, x)) - set(a))
max = len(sub)
i = 0
sy... | output | 1 | 64,346 | 17 | 128,693 |
Provide a correct Python 3 solution for this coding contest problem.
We will host a rock-paper-scissors tournament with N people. The participants are called Person 1, Person 2, \ldots, Person N. For any two participants, the result of the match between them is determined in advance. This information is represented by... | instruction | 0 | 64,634 | 17 | 129,268 |
"Correct Solution:
```
N = int(input())
X = [[0] * N for _ in range(N)]
for i in range(1, N):
X[i][:i] = [int(a) for a in input()]
for i in range(N):
for j in range(i+1, N):
X[i][j] = X[j][i]^1
A = [1<<i for i in range(N)]
B = [1<<i for i in range(N)]
for i in range(N):
for j in range(i):
i... | output | 1 | 64,634 | 17 | 129,269 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
We will host a rock-paper-scissors tournament with N people. The participants are called Person 1, Person 2, \ldots, Person N. For any two participants, the result of the match between them is d... | instruction | 0 | 64,635 | 17 | 129,270 |
No | output | 1 | 64,635 | 17 | 129,271 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
We will host a rock-paper-scissors tournament with N people. The participants are called Person 1, Person 2, \ldots, Person N. For any two participants, the result of the match between them is d... | instruction | 0 | 64,636 | 17 | 129,272 |
No | output | 1 | 64,636 | 17 | 129,273 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
We will host a rock-paper-scissors tournament with N people. The participants are called Person 1, Person 2, \ldots, Person N. For any two participants, the result of the match between them is d... | instruction | 0 | 64,637 | 17 | 129,274 |
No | output | 1 | 64,637 | 17 | 129,275 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to the following rules:
* in each game, two rand... | instruction | 0 | 65,076 | 17 | 130,152 |
Tags: binary search, data structures, greedy
Correct Solution:
```
for _ in range(int(input())):
n = int(input())
a = sorted(zip(map(int, input().split()), range(n)))
l, r = 0, n-1
while l < r:
m = (l+r) // 2
s0 = sum(a[i][0] for i in range(m+1))
flag = True
for i in ... | output | 1 | 65,076 | 17 | 130,153 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to the following rules:
* in each game, two rand... | instruction | 0 | 65,077 | 17 | 130,154 |
Tags: binary search, data structures, greedy
Correct Solution:
```
for _ in range(int(input())):
input()
arr = map(int,input().split())
u = sorted((a,i) for i,a in enumerate(arr, 1))
cur = 0
res = []
for a,i in u:
if cur < a:
res.clear()
res.append(i)
cur += a... | output | 1 | 65,077 | 17 | 130,155 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to the following rules:
* in each game, two rand... | instruction | 0 | 65,078 | 17 | 130,156 |
Tags: binary search, data structures, greedy
Correct Solution:
```
from bisect import insort_left
from collections import deque
T = int(input())
for _ in range(T):
N = int(input())
ori_nums = list(map(int, input().split()))
nums = []
for i in range(N):
nums.append((ori_nums[i], i + 1))
num... | output | 1 | 65,078 | 17 | 130,157 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to the following rules:
* in each game, two rand... | instruction | 0 | 65,079 | 17 | 130,158 |
Tags: binary search, data structures, greedy
Correct Solution:
```
import sys,math,itertools
from collections import Counter,deque,defaultdict
from bisect import bisect_left,bisect_right
from heapq import heappop,heappush,heapify, nlargest
from copy import deepcopy
mod = 10**9+7
INF = float('inf')
def inp(): return in... | output | 1 | 65,079 | 17 | 130,159 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to the following rules:
* in each game, two rand... | instruction | 0 | 65,080 | 17 | 130,160 |
Tags: binary search, data structures, greedy
Correct Solution:
```
for _ in range(int(input())):
n = int(input())
A = list(map(int , input().split()))
x = [0] * n
for i in range(n):
x[i] = A[i]
A.sort(reverse = True)
l = 0
r = n -1
B = [0]*n
B[n -1] = A[n - 1]
for i in r... | output | 1 | 65,080 | 17 | 130,161 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to the following rules:
* in each game, two rand... | instruction | 0 | 65,081 | 17 | 130,162 |
Tags: binary search, data structures, greedy
Correct Solution:
```
from sys import stdin
input = stdin.readline
def check_win(index):
z = b[index]
for i in range(n):
if i == index:
continue
if z >= b[i]:
z += b[i]
if z >= b[-1]:
return True
... | output | 1 | 65,081 | 17 | 130,163 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to the following rules:
* in each game, two rand... | instruction | 0 | 65,082 | 17 | 130,164 |
Tags: binary search, data structures, greedy
Correct Solution:
```
import math
import collections
def read_list() -> list:
return [int(i) for i in input().strip().split()]
def read_num() -> int:
return int(input().strip())
t = read_num()
for i in range(t):
n = read_num()
arr = read_list()
idx_to... | output | 1 | 65,082 | 17 | 130,165 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to the following rules:
* in each game, two rand... | instruction | 0 | 65,083 | 17 | 130,166 |
Tags: binary search, data structures, greedy
Correct Solution:
```
for _ in range(int(input())):
n=int(input())
arr=list(map(int,input().split()));d={}
d1={}
arr1=[]
for i in range(n):
d[arr[i]]=d.get(arr[i],0)+1
for i in d:
arr1.append([d[i],i])
arr1=sorted(arr1,key=lambda x:x[1])
summ=sum(... | output | 1 | 65,083 | 17 | 130,167 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to t... | instruction | 0 | 65,084 | 17 | 130,168 |
Yes | output | 1 | 65,084 | 17 | 130,169 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to t... | instruction | 0 | 65,085 | 17 | 130,170 |
Yes | output | 1 | 65,085 | 17 | 130,171 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to t... | instruction | 0 | 65,086 | 17 | 130,172 |
Yes | output | 1 | 65,086 | 17 | 130,173 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to t... | instruction | 0 | 65,087 | 17 | 130,174 |
Yes | output | 1 | 65,087 | 17 | 130,175 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to t... | instruction | 0 | 65,088 | 17 | 130,176 |
No | output | 1 | 65,088 | 17 | 130,177 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to t... | instruction | 0 | 65,089 | 17 | 130,178 |
No | output | 1 | 65,089 | 17 | 130,179 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to t... | instruction | 0 | 65,090 | 17 | 130,180 |
No | output | 1 | 65,090 | 17 | 130,181 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A championship is held in Berland, in which n players participate. The player with the number i has a_i (a_i ≥ 1) tokens.
The championship consists of n-1 games, which are played according to t... | instruction | 0 | 65,091 | 17 | 130,182 |
No | output | 1 | 65,091 | 17 | 130,183 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph.
There are n toy cars. Each pair collides. The result ... | instruction | 0 | 65,190 | 17 | 130,380 |
Tags: implementation
Correct Solution:
```
#!/usr/bin/python3
import itertools as ittls
from collections import Counter
import re
def inputarray(func=int):
return map(func, input().split())
# ---------------------------------------
# --------------------------------------
N = int(input())
mask = [1]*N
for i ... | output | 1 | 65,190 | 17 | 130,381 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph.
There are n toy cars. Each pair collides. The result ... | instruction | 0 | 65,191 | 17 | 130,382 |
Tags: implementation
Correct Solution:
```
n=int(input())
k=0; b=[]
for i in range(n):
s=input().replace("-1","4")
if s.find("3")==-1 and s.find("1")==-1:
k+=1
b.append(i+1)
print(k)
if k>0:
z=""
for x in b:
z+=str(x)+" "
print(z)
``` | output | 1 | 65,191 | 17 | 130,383 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph.
There are n toy cars. Each pair collides. The result ... | instruction | 0 | 65,192 | 17 | 130,384 |
Tags: implementation
Correct Solution:
```
n = int(input())
L = []
for j in range(n):
T = [int(x) for x in input().split()]
for i in T:
if i == 3 or i == 1:
break
else:
L.append(j)
print(len(L))
for i in L:
print(i+1, end = ' ')
``` | output | 1 | 65,192 | 17 | 130,385 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph.
There are n toy cars. Each pair collides. The result ... | instruction | 0 | 65,193 | 17 | 130,386 |
Tags: implementation
Correct Solution:
```
n=int(input())
l=[]
for i in range(n):
a=[int(i) for i in input().split()]
if(1 in a or 3 in a):
pass
else:
l.append(i+1)
print(len(l))
print(*l)
``` | output | 1 | 65,193 | 17 | 130,387 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph.
There are n toy cars. Each pair collides. The result ... | instruction | 0 | 65,194 | 17 | 130,388 |
Tags: implementation
Correct Solution:
```
n = int(input())
matrix = [[int(i) for i in input().split()] for j in range(n)]
cars = [True] * n
for i in range(len(matrix)):
for j in range(len(matrix)):
if matrix[i][j] == 1:
cars[i] = False
if matrix[i][j] == 2:
cars[j] = False
... | output | 1 | 65,194 | 17 | 130,389 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph.
There are n toy cars. Each pair collides. The result ... | instruction | 0 | 65,195 | 17 | 130,390 |
Tags: implementation
Correct Solution:
```
n = int(input())
a = [list(map(int, input().split())) for _ in range(n)]
ans = []
for i in range(n):
a[i].remove(-1)
ok = 1
for j in range(n-1):
if a[i][j] & 1:
ok = 0
if ok:
ans.append(i + 1)
print(len(ans))
print(' '.join(map(str, ans)))
``` | output | 1 | 65,195 | 17 | 130,391 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph.
There are n toy cars. Each pair collides. The result ... | instruction | 0 | 65,196 | 17 | 130,392 |
Tags: implementation
Correct Solution:
```
import sys
import bisect
#input=sys.stdin.readline
#t=int(input())
t=1
for _ in range(t):
#n,m=map(int,input().split())
n=int(input())
l=[]
for i in range(n):
l.append(list(map(int,input().split())))
ans=[0]*(n+1)
for i in range(n):
for ... | output | 1 | 65,196 | 17 | 130,393 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph.
There are n toy cars. Each pair collides. The result ... | instruction | 0 | 65,197 | 17 | 130,394 |
Tags: implementation
Correct Solution:
```
z=[]
for i in range(1,int(input())+1):
a=list(map(int,input().split()))
if 1 not in a and 3 not in a:z+=[i]
print(len(z),"\n",*z,end=" ")
``` | output | 1 | 65,197 | 17 | 130,395 |
Provide tags and a correct Python 3 solution for this coding contest problem.
International Abbreviation Olympiad takes place annually starting from 1989. Each year the competition receives an abbreviation of form IAO'y, where y stands for some number of consequent last digits of the current year. Organizers always pi... | instruction | 0 | 65,249 | 17 | 130,498 |
Tags: constructive algorithms, greedy, implementation, math
Correct Solution:
```
from __future__ import print_function
dic = {"9":"1989","0":"1990","1":"1991","2":"1992","3":"1993","4":"1994","5":"1995","6":"1996","7":"1997","8":"1998"}
def get_year(s):
# print("came into get_year")
length=len(s)
if len(s)==1:
... | output | 1 | 65,249 | 17 | 130,499 |
Provide tags and a correct Python 3 solution for this coding contest problem.
International Abbreviation Olympiad takes place annually starting from 1989. Each year the competition receives an abbreviation of form IAO'y, where y stands for some number of consequent last digits of the current year. Organizers always pi... | instruction | 0 | 65,250 | 17 | 130,500 |
Tags: constructive algorithms, greedy, implementation, math
Correct Solution:
```
T=int(input())
for _ in range(T):
s=input()
s=s[4:]
l=len(s)
s=int(s)
x=1988
t=1
for i in range(l):
y=s%(t*10)
z=x%(t*10)
while True:
x=x+t
z=x%(t*10)
if y==z:
break
t=t*10
print(x)
``` | output | 1 | 65,250 | 17 | 130,501 |
Provide tags and a correct Python 3 solution for this coding contest problem.
International Abbreviation Olympiad takes place annually starting from 1989. Each year the competition receives an abbreviation of form IAO'y, where y stands for some number of consequent last digits of the current year. Organizers always pi... | instruction | 0 | 65,251 | 17 | 130,502 |
Tags: constructive algorithms, greedy, implementation, math
Correct Solution:
```
def mp(): return map(int,input().split())
def lt(): return list(map(int,input().split()))
def pt(x): print(x)
def ip(): return input()
def it(): return int(input())
def sl(x): return [t for t in x]
def spl(x): return x.split()
def a... | output | 1 | 65,251 | 17 | 130,503 |
Provide tags and a correct Python 3 solution for this coding contest problem.
International Abbreviation Olympiad takes place annually starting from 1989. Each year the competition receives an abbreviation of form IAO'y, where y stands for some number of consequent last digits of the current year. Organizers always pi... | instruction | 0 | 65,252 | 17 | 130,504 |
Tags: constructive algorithms, greedy, implementation, math
Correct Solution:
```
import sys
import math
import itertools as it
import operator as op
import fractions as fr
L = [1989]
d = 10
for i in range(9):
L.append(L[-1]+d)
d *= 10
n = int(sys.stdin.readline())
for _ in range(n):
s = sys.stdin.readline().s... | output | 1 | 65,252 | 17 | 130,505 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.