message stringlengths 2 65.1k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 0 108k | cluster float64 14 14 | __index_level_0__ int64 0 217k |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
According to Berland laws it is only allowed to sell alcohol to people not younger than 18 years. Vasya's job is to monitor the law's enforcement. Tonight he entered a bar and saw n people sitting there. For every one of them Vasya happened ... | instruction | 0 | 6,205 | 14 | 12,410 |
Tags: implementation
Correct Solution:
```
n = int(input())
alco = ["ABSINTH", "BEER", 'BRANDY', 'CHAMPAGNE', 'GIN', 'RUM', 'SAKE', 'TEQUILA', 'VODKA', 'WHISKEY', 'WINE']
count = 0
while n>0:
n-=1
s = input()
if s.isdecimal():
if int(s)<18:
count+=1
else:
if s in alco:
... | output | 1 | 6,205 | 14 | 12,411 |
Provide tags and a correct Python 3 solution for this coding contest problem.
According to Berland laws it is only allowed to sell alcohol to people not younger than 18 years. Vasya's job is to monitor the law's enforcement. Tonight he entered a bar and saw n people sitting there. For every one of them Vasya happened ... | instruction | 0 | 6,206 | 14 | 12,412 |
Tags: implementation
Correct Solution:
```
data=['ABSINTH',
'BEER',
'BRANDY',
'CHAMPAGNE',
'GIN',
'RUM',
'SAKE',
'TEQUILA',
'VODKA',
'WHISKEY',
'WINE',
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9'... | output | 1 | 6,206 | 14 | 12,413 |
Provide tags and a correct Python 3 solution for this coding contest problem.
According to Berland laws it is only allowed to sell alcohol to people not younger than 18 years. Vasya's job is to monitor the law's enforcement. Tonight he entered a bar and saw n people sitting there. For every one of them Vasya happened ... | instruction | 0 | 6,208 | 14 | 12,416 |
Tags: implementation
Correct Solution:
```
alc=["ABSINTH", "BEER", "BRANDY", "CHAMPAGNE", "GIN", "RUM", "SAKE", "TEQUILA", "VODKA", "WHISKEY", "WINE"];p=0
for _ in range(int(input())):
x=input()
if len(x)<=2:
if ord(x[0])>=65: continue
else:
x=int(x)
if x<18: p+=1
els... | output | 1 | 6,208 | 14 | 12,417 |
Provide tags and a correct Python 3 solution for this coding contest problem.
According to Berland laws it is only allowed to sell alcohol to people not younger than 18 years. Vasya's job is to monitor the law's enforcement. Tonight he entered a bar and saw n people sitting there. For every one of them Vasya happened ... | instruction | 0 | 6,209 | 14 | 12,418 |
Tags: implementation
Correct Solution:
```
#!/usr/bin/env python3
num = int(input())
lis = ['ABSINTH', 'BEER', 'BRANDY', 'CHAMPAGNE', 'GIN', 'RUM', 'SAKE', 'TEQUILA', 'VODKA', 'WHISKEY', 'WINE']
cnt = 0
for i in range(num):
s = input()
if s in lis:
cnt += 1
#
continue
if s.isdigit():
s = int(s)
if(s<18)... | output | 1 | 6,209 | 14 | 12,419 |
Provide tags and a correct Python 3 solution for this coding contest problem.
According to Berland laws it is only allowed to sell alcohol to people not younger than 18 years. Vasya's job is to monitor the law's enforcement. Tonight he entered a bar and saw n people sitting there. For every one of them Vasya happened ... | instruction | 0 | 6,210 | 14 | 12,420 |
Tags: implementation
Correct Solution:
```
def solve(arr):
count = 0
for i in arr:
if i.isnumeric():
if int(i) < 18:
count += 1
elif i in ["ABSINTH", "BEER", "BRANDY", "CHAMPAGNE", "GIN", "RUM", "SAKE", "TEQUILA", "VODKA", "WHISKEY", "WINE"]:
count += 1
... | output | 1 | 6,210 | 14 | 12,421 |
Provide tags and a correct Python 3 solution for this coding contest problem.
According to Berland laws it is only allowed to sell alcohol to people not younger than 18 years. Vasya's job is to monitor the law's enforcement. Tonight he entered a bar and saw n people sitting there. For every one of them Vasya happened ... | instruction | 0 | 6,211 | 14 | 12,422 |
Tags: implementation
Correct Solution:
```
a=["ABSINTH", "BEER", "BRANDY", "CHAMPAGNE", "GIN", "RUM", "SAKE", "TEQUILA", "VODKA", "WHISKEY", "WINE"]
ans=0
for i in range(int(input())):
x=input()
if x in a:
ans+=1
else:
try:
y=int(x)
if y<18:
ans+=1
... | output | 1 | 6,211 | 14 | 12,423 |
Provide tags and a correct Python 3 solution for this coding contest problem.
According to Berland laws it is only allowed to sell alcohol to people not younger than 18 years. Vasya's job is to monitor the law's enforcement. Tonight he entered a bar and saw n people sitting there. For every one of them Vasya happened ... | instruction | 0 | 6,212 | 14 | 12,424 |
Tags: implementation
Correct Solution:
```
t = int(input())
alco = "ABSINTH, BEER, BRANDY, CHAMPAGNE, GIN, RUM, SAKE, TEQUILA, VODKA, WHISKEY, WINE".replace(",","").split()
check = 0
for _ in range(t):
n = input()
check += int(n.isdigit() and int(n) < 18 or n in alco)
print(check)
``` | output | 1 | 6,212 | 14 | 12,425 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
According to Berland laws it is only allowed to sell alcohol to people not younger than 18 years. Vasya's job is to monitor the law's enforcement. Tonight he entered a bar and saw n people sitti... | instruction | 0 | 6,215 | 14 | 12,430 |
Yes | output | 1 | 6,215 | 14 | 12,431 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Author note: I think some of you might remember the problem "Two Melodies" from Eductational Codeforces Round 22. Now it's time to make it a bit more difficult!
Alice is a composer, and recently she had recorded two tracks that became very ... | instruction | 0 | 6,274 | 14 | 12,548 |
Tags: flows, graphs
Correct Solution:
```
import sys
def solve():
n = int(sys.stdin.readline())
a = [0] + [int(i) for i in sys.stdin.readline().split()]
dp = [[0]*(n + 1) for i in range(n + 1)]
ans = 0
maxnum = [0] * (10**5 + 2)
maxmod = [0] * 7
for y in range(n + 1):
maxmod = [0... | output | 1 | 6,274 | 14 | 12,549 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Author note: I think some of you might remember the problem "Two Melodies" from Eductational Codeforces Round 22. Now it's time to make it a bit more difficult!
Alice is a composer, and recently she had recorded two tracks that became very ... | instruction | 0 | 6,275 | 14 | 12,550 |
Tags: flows, graphs
Correct Solution:
```
import sys
n = int(sys.stdin.readline())
a = [0] + [int(i) for i in sys.stdin.readline().split()]
dp = [[0]*(n + 1) for i in range(n + 1)]
ans = 0
maxnum = [0] * (10**5 + 2)
maxmod = [0] * 7
for y in range(n + 1):
maxmod = [0] * 7
for ai in a:
maxnum[ai... | output | 1 | 6,275 | 14 | 12,551 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.
Mishka is really interested in calculus, though it is so hard to stay awake for all the time of lecture. You a... | instruction | 0 | 6,333 | 14 | 12,666 |
Tags: data structures, dp, implementation, two pointers
Correct Solution:
```
n, k = [int(x) for x in input().split(' ')]
a = [int(x) for x in input().split(' ')]
t = [int(x) for x in input().split(' ')]
g = sum([a[x] for x in range(n) if t[x] == 1])
max_app_g = 0
app_g = 0
for i in range(n):
if t[i] == 0:
... | output | 1 | 6,333 | 14 | 12,667 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.
Mishka is really interested in calculus, though it is so hard to stay awake for all the time of lecture. You a... | instruction | 0 | 6,334 | 14 | 12,668 |
Tags: data structures, dp, implementation, two pointers
Correct Solution:
```
def main():
n, k = map(int, input().split())
a = [int(c) for c in input().split()]
t = [int(c) for c in input().split()]
diff = 0
i = 0
s = 0
ii = jj = 0
while i < n:
ii += a[i]
if i - k >= 0:
... | output | 1 | 6,334 | 14 | 12,669 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.
Mishka is really interested in calculus, though it is so hard to stay awake for all the time of lecture. You a... | instruction | 0 | 6,335 | 14 | 12,670 |
Tags: data structures, dp, implementation, two pointers
Correct Solution:
```
n, k = [int(x) for x in input().split()]
a = list(map(int, input().split()))
t = list(map(int, input().split()))
m = 0
s = 0
temp = 0
for i in range(n):
m = max(m, temp)
if i >= k:
ch = i - k
if t[ch] == 0:
... | output | 1 | 6,335 | 14 | 12,671 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.
Mishka is really interested in calculus, though it is so hard to stay awake for all the time of lecture. You a... | instruction | 0 | 6,336 | 14 | 12,672 |
Tags: data structures, dp, implementation, two pointers
Correct Solution:
```
a = input()
b = input()
c = input()
a = a.split(' ')
b = b.split(' ')
c = c.split(' ')
for i in range(len(a)):
a[i] = int(a[i])
for i in range(len(b)):
b[i] = int(b[i])
for i in range(len(c)):
c[i] = int(c[i])
def blower():
d... | output | 1 | 6,336 | 14 | 12,673 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.
Mishka is really interested in calculus, though it is so hard to stay awake for all the time of lecture. You a... | instruction | 0 | 6,337 | 14 | 12,674 |
Tags: data structures, dp, implementation, two pointers
Correct Solution:
```
(n, k) = map(int, input().split())
lst = []
for x in input().split():
lst.append(int(x))
array = []
for x in input().split():
array.append(int(x))
mass1 = [0]
for x in range(n):
mass1.append(mass1[-1] + lst[x])
mass2 = [0]
for... | output | 1 | 6,337 | 14 | 12,675 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.
Mishka is really interested in calculus, though it is so hard to stay awake for all the time of lecture. You a... | instruction | 0 | 6,338 | 14 | 12,676 |
Tags: data structures, dp, implementation, two pointers
Correct Solution:
```
n,k = map(int, input().split())
theorems = [int(i) for i in input().split()]
wake = [int(i) for i in input().split()]
acu = 0
for i in range(n):
if wake[i] == 1:
acu += theorems[i]
elif i < k:
acu += theorems[i]
ans =... | output | 1 | 6,338 | 14 | 12,677 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.
Mishka is really interested in calculus, though it is so hard to stay awake for all the time of lecture. You a... | instruction | 0 | 6,339 | 14 | 12,678 |
Tags: data structures, dp, implementation, two pointers
Correct Solution:
```
#pyrival orz
import os
import sys
from io import BytesIO, IOBase
input = sys.stdin.readline
############ ---- Input Functions ---- ############
def inp():
return(int(input()))
def inlt():
return(list(map(int,input().split())))
def in... | output | 1 | 6,339 | 14 | 12,679 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.
Mishka is really interested in calculus, though it is so hard to stay awake for all the time of lecture. You a... | instruction | 0 | 6,340 | 14 | 12,680 |
Tags: data structures, dp, implementation, two pointers
Correct Solution:
```
import sys
input = sys.stdin.readline
import math
import copy
import collections
from collections import deque
import heapq
import itertools
from collections import defaultdict
from collections import Counter
n,k = map(int,input().split())
a... | output | 1 | 6,340 | 14 | 12,681 |
Provide a correct Python 3 solution for this coding contest problem.
There is the word heuristics. It's a relatively simple approach that usually works, although there is no guarantee that it will work. The world is full of heuristics because it is simple and powerful.
Some examples of heuristics include: In an anime... | instruction | 0 | 6,529 | 14 | 13,058 |
"Correct Solution:
```
import sys
input = sys.stdin.readline
while True:
n, m, k, l = map(int, input().split())
if n == 0:
break
ranking = []
for _ in range(n):
name, x = input().split()
x = int(x)
ranking.append([x, name])
ranking.sort(key=lambda x:(-x[0], x[1]))
favs = {input().strip() ... | output | 1 | 6,529 | 14 | 13,059 |
Provide tags and a correct Python 3 solution for this coding contest problem.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike each other. To make party successful, the Smar... | instruction | 0 | 6,878 | 14 | 13,756 |
Tags: dfs and similar, dsu, graphs
Correct Solution:
```
from sys import stdin, stdout
def find(node):
x = []
while dsu[node] > 0:
x.append(node)
node = dsu[node]
for i in x:
dsu[i] = node
return node
def union(node1, node2):
if node1 != node2:
if dsu[node1] > dsu[n... | output | 1 | 6,878 | 14 | 13,757 |
Provide tags and a correct Python 3 solution for this coding contest problem.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike each other. To make party successful, the Smar... | instruction | 0 | 6,879 | 14 | 13,758 |
Tags: dfs and similar, dsu, graphs
Correct Solution:
```
from sys import setrecursionlimit
setrecursionlimit(10 ** 9)
def dfs(g, col, st):
global used
used[st] = col
for w in g[st]:
if used[w] is False:
dfs(g, col, w)
n = int(input())
k = int(input())
g = []
used = [False] * n
for... | output | 1 | 6,879 | 14 | 13,759 |
Provide tags and a correct Python 3 solution for this coding contest problem.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike each other. To make party successful, the Smar... | instruction | 0 | 6,880 | 14 | 13,760 |
Tags: dfs and similar, dsu, graphs
Correct Solution:
```
t, p, k = [0] * (int(input()) + 1), {0: []}, 1
for i in range(int(input())):
a, b = map(int, input().split())
if t[a] == t[b]:
if t[a] == 0:
t[a] = t[b] = k
p[k] = [a, b]
k += 1
else:
if ... | output | 1 | 6,880 | 14 | 13,761 |
Provide tags and a correct Python 3 solution for this coding contest problem.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike each other. To make party successful, the Smar... | instruction | 0 | 6,881 | 14 | 13,762 |
Tags: dfs and similar, dsu, graphs
Correct Solution:
```
class DSNode:
def __init__(self, val):
self.val = val
self.rank = 0
self.parent = self
self.correct = True
def __str__(self):
return str(self.find().val)
def find(self):
x = self
if x != x.pare... | output | 1 | 6,881 | 14 | 13,763 |
Provide tags and a correct Python 3 solution for this coding contest problem.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike each other. To make party successful, the Smar... | instruction | 0 | 6,882 | 14 | 13,764 |
Tags: dfs and similar, dsu, graphs
Correct Solution:
```
n = int(input())
l = int(input())
likes_list = [[] for i in range(n + 1)]
for i in range(l):
a, b = map(int, input().split())
likes_list[a].append(b)
likes_list[b].append(a)
d = int(input())
dislikes_list = [[] for i in range(n + 1)]
for i in range(d... | output | 1 | 6,882 | 14 | 13,765 |
Provide tags and a correct Python 3 solution for this coding contest problem.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike each other. To make party successful, the Smar... | instruction | 0 | 6,883 | 14 | 13,766 |
Tags: dfs and similar, dsu, graphs
Correct Solution:
```
# Problem: C1. Party
# Contest: Codeforces - ABBYY Cup 2.0 - Easy
# URL: https://codeforces.com/contest/177/problem/C1
# Memory Limit: 256 MB
# Time Limit: 2000 ms
#
# KAPOOR'S
from sys import stdin, stdout
def INI():
return int(stdin.readline())
def INL()... | output | 1 | 6,883 | 14 | 13,767 |
Provide tags and a correct Python 3 solution for this coding contest problem.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike each other. To make party successful, the Smar... | instruction | 0 | 6,884 | 14 | 13,768 |
Tags: dfs and similar, dsu, graphs
Correct Solution:
```
def find(a):
if parent[a]!=a:
parent[a]=find(parent[a])
return parent[a]
def union(a,b):
u,v=find(a),find(b)
if u==v:
return
if rank[u]>rank[v]:
parent[v]=u
else:
parent[u]=v
if rank[u]==rank[v]:
... | output | 1 | 6,884 | 14 | 13,769 |
Provide tags and a correct Python 3 solution for this coding contest problem.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike each other. To make party successful, the Smar... | instruction | 0 | 6,885 | 14 | 13,770 |
Tags: dfs and similar, dsu, graphs
Correct Solution:
```
n = int(input())
num_likes = int(input())
like = [ [] for u in range(n + 1) ]
for i in range(num_likes):
u, v = map(int, input().split())
like[u].append(v)
like[v].append(u)
num_dislikes = int(input())
dislike = [ (n + 1) * [ False ] for u in range(n ... | output | 1 | 6,885 | 14 | 13,771 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike... | instruction | 0 | 6,886 | 14 | 13,772 |
Yes | output | 1 | 6,886 | 14 | 13,773 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike... | instruction | 0 | 6,887 | 14 | 13,774 |
Yes | output | 1 | 6,887 | 14 | 13,775 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike... | instruction | 0 | 6,888 | 14 | 13,776 |
Yes | output | 1 | 6,888 | 14 | 13,777 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike... | instruction | 0 | 6,889 | 14 | 13,778 |
Yes | output | 1 | 6,889 | 14 | 13,779 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike... | instruction | 0 | 6,890 | 14 | 13,780 |
No | output | 1 | 6,890 | 14 | 13,781 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike... | instruction | 0 | 6,891 | 14 | 13,782 |
No | output | 1 | 6,891 | 14 | 13,783 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike... | instruction | 0 | 6,892 | 14 | 13,784 |
No | output | 1 | 6,892 | 14 | 13,785 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike... | instruction | 0 | 6,893 | 14 | 13,786 |
No | output | 1 | 6,893 | 14 | 13,787 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of multiple messages.
Recent actions shows a list ... | instruction | 0 | 6,934 | 14 | 13,868 |
Tags: data structures, greedy, implementation
Correct Solution:
```
t=int(input())
arr=list(map(int,input().split()))
i=t-1
while( i>0 and arr[i] > arr[i-1] ):
i-=1
print(i)
``` | output | 1 | 6,934 | 14 | 13,869 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of multiple messages.
Recent actions shows a list ... | instruction | 0 | 6,935 | 14 | 13,870 |
Tags: data structures, greedy, implementation
Correct Solution:
```
import sys
n = int(sys.stdin.readline())
l = list(map(int, sys.stdin.readline().split()))[::-1]
ans = 0
acc = n
pre = 9999999999999
for i in range(n):
if l[i] < pre:
ans += 1
pre = l[i]
else:
break
print(n-ans)
``` | output | 1 | 6,935 | 14 | 13,871 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of multiple messages.
Recent actions shows a list ... | instruction | 0 | 6,936 | 14 | 13,872 |
Tags: data structures, greedy, implementation
Correct Solution:
```
# ANDRE CHEKER BURIHAN RA 194071
noth = int(input())
oldpos = [int(num) for num in input().split()]
newpos = [i+1 for i in range(noth)]
counter = 0
if oldpos != newpos:
for i in reversed(range(1, noth)):
if oldpos[i-1] > oldpos[i]:
... | output | 1 | 6,936 | 14 | 13,873 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of multiple messages.
Recent actions shows a list ... | instruction | 0 | 6,937 | 14 | 13,874 |
Tags: data structures, greedy, implementation
Correct Solution:
```
n = int(input())
a = (str(input())).split(' ')
ma=0
output = 0
for i in range(n-1):
if int(a[i])<int(a[i+1]):
ma+=1
else:
output+=1+ma
ma=0
print(output)
``` | output | 1 | 6,937 | 14 | 13,875 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of multiple messages.
Recent actions shows a list ... | instruction | 0 | 6,938 | 14 | 13,876 |
Tags: data structures, greedy, implementation
Correct Solution:
```
n=input()
arr=input().split(" ")
asc=1
x=int(arr[0])
for i in range(1,int(n)):
if int(arr[i])>x:
asc+=1
else:
asc=1
x=int(arr[i])
print(int(n)-asc)
``` | output | 1 | 6,938 | 14 | 13,877 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of multiple messages.
Recent actions shows a list ... | instruction | 0 | 6,939 | 14 | 13,878 |
Tags: data structures, greedy, implementation
Correct Solution:
```
if __name__ == '__main__':
n = int(input())
q = (list(map(int, input().split())))
index = 0
for i in range(n-1, 0, -1):
if(q[i-1] > q[i]):
index = i
break
print(index)
``... | output | 1 | 6,939 | 14 | 13,879 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of multiple messages.
Recent actions shows a list ... | instruction | 0 | 6,940 | 14 | 13,880 |
Tags: data structures, greedy, implementation
Correct Solution:
```
n, ar = int(input()), [int(x) for x in input().split()][::-1]
ans = 0
for i in range(1, n):
if ar[i] > ar[i - 1]:
ans = n - i
break
print(ans)
``` | output | 1 | 6,940 | 14 | 13,881 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of multiple messages.
Recent actions shows a list ... | instruction | 0 | 6,941 | 14 | 13,882 |
Tags: data structures, greedy, implementation
Correct Solution:
```
num = int(input())
arr = list(map(int,input().split()))
i = num-1
while arr[i] > arr[i-1]:
i -= 1
print(i)
``` | output | 1 | 6,941 | 14 | 13,883 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of m... | instruction | 0 | 6,942 | 14 | 13,884 |
Yes | output | 1 | 6,942 | 14 | 13,885 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of m... | instruction | 0 | 6,943 | 14 | 13,886 |
Yes | output | 1 | 6,943 | 14 | 13,887 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of m... | instruction | 0 | 6,944 | 14 | 13,888 |
Yes | output | 1 | 6,944 | 14 | 13,889 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of m... | instruction | 0 | 6,945 | 14 | 13,890 |
Yes | output | 1 | 6,945 | 14 | 13,891 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of m... | instruction | 0 | 6,946 | 14 | 13,892 |
No | output | 1 | 6,946 | 14 | 13,893 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of m... | instruction | 0 | 6,947 | 14 | 13,894 |
No | output | 1 | 6,947 | 14 | 13,895 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of m... | instruction | 0 | 6,948 | 14 | 13,896 |
No | output | 1 | 6,948 | 14 | 13,897 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.