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. Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the pebbles she could find in the park. She has o...
instruction
0
60,289
14
120,578
Tags: implementation, math Correct Solution: ``` import math n,k=map(int,input().split()) w=list(map(int,input().split())) c=0 for i in range(n): c+=(w[i]+k-1)//k print((c+1)//2) ```
output
1
60,289
14
120,579
Provide tags and a correct Python 3 solution for this coding contest problem. Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the pebbles she could find in the park. She has o...
instruction
0
60,290
14
120,580
Tags: implementation, math Correct Solution: ``` s = input() (n,k) = s.split() n = int(n) k = int(k) w = list() ret = 0 s = input() w = s.split() for i in w: t = int(i) ret += (t+k-1)//k ret = (ret+1)//2 print(ret) ```
output
1
60,290
14
120,581
Provide tags and a correct Python 3 solution for this coding contest problem. Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the pebbles she could find in the park. She has o...
instruction
0
60,291
14
120,582
Tags: implementation, math Correct Solution: ``` import math # import bisect import sys # from collections import OrderedDict input = sys.stdin.readline def inp(): return(int(input())) def inlt(): return(list(map(int,input().split()))) def insr(): s = input() return(s[:len(s)-1]) def invr(): return(map(int,input()...
output
1
60,291
14
120,583
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the...
instruction
0
60,292
14
120,584
Yes
output
1
60,292
14
120,585
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the...
instruction
0
60,293
14
120,586
Yes
output
1
60,293
14
120,587
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the...
instruction
0
60,294
14
120,588
Yes
output
1
60,294
14
120,589
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the...
instruction
0
60,295
14
120,590
Yes
output
1
60,295
14
120,591
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the...
instruction
0
60,296
14
120,592
No
output
1
60,296
14
120,593
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the...
instruction
0
60,297
14
120,594
No
output
1
60,297
14
120,595
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the...
instruction
0
60,298
14
120,596
No
output
1
60,298
14
120,597
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the...
instruction
0
60,299
14
120,598
No
output
1
60,299
14
120,599
Provide tags and a correct Python 3 solution for this coding contest problem. The Central Company has an office with a sophisticated security system. There are 10^6 employees, numbered from 1 to 10^6. The security system logs entrances and departures. The entrance of the i-th employee is denoted by the integer i, whi...
instruction
0
60,753
14
121,506
Tags: greedy, implementation Correct Solution: ``` n = int(input()) array = list(map(int, input().strip().split())) s = [] value = 0 d = {} already_visited = set() for i in array: value += 1 if i > 0: if i not in d and i not in already_visited: d[i] = 1 else: print(-1) ...
output
1
60,753
14
121,507
Provide tags and a correct Python 3 solution for this coding contest problem. The Central Company has an office with a sophisticated security system. There are 10^6 employees, numbered from 1 to 10^6. The security system logs entrances and departures. The entrance of the i-th employee is denoted by the integer i, whi...
instruction
0
60,754
14
121,508
Tags: greedy, implementation Correct Solution: ``` n = int(input()) l = list(map(int,input().split())) mat = [] sumka = 0 stan = [0] * (10**6+1) dasie = True weszli = {} for i in range(n): if i > 0 and sumka == 0: weszli = {} mat.append(i) stan[abs(l[i])] += abs(l[i])/l[i] try: weszli[l[i]] += 1 except Except...
output
1
60,754
14
121,509
Provide tags and a correct Python 3 solution for this coding contest problem. The Central Company has an office with a sophisticated security system. There are 10^6 employees, numbered from 1 to 10^6. The security system logs entrances and departures. The entrance of the i-th employee is denoted by the integer i, whi...
instruction
0
60,755
14
121,510
Tags: greedy, implementation Correct Solution: ``` import math,sys from collections import Counter, defaultdict, deque from sys import stdin, stdout input = stdin.readline lili=lambda:list(map(int,sys.stdin.readlines())) li = lambda:list(map(int,input().split())) #for deque append(),pop(),appendleft(),popleft(),count()...
output
1
60,755
14
121,511
Provide tags and a correct Python 3 solution for this coding contest problem. The Central Company has an office with a sophisticated security system. There are 10^6 employees, numbered from 1 to 10^6. The security system logs entrances and departures. The entrance of the i-th employee is denoted by the integer i, whi...
instruction
0
60,756
14
121,512
Tags: greedy, implementation Correct Solution: ``` n = int(input()) a = list(map(int, input().split())) ans = [] days = -1 counter = 0 set_in = set() set_out = set() for i in range(n): if a[i] > 0: if a[i] in set_in or (-1 * a[i]) in set_out: print(-1) exit(0) set_in.add(a[i]...
output
1
60,756
14
121,513
Provide tags and a correct Python 3 solution for this coding contest problem. The Central Company has an office with a sophisticated security system. There are 10^6 employees, numbered from 1 to 10^6. The security system logs entrances and departures. The entrance of the i-th employee is denoted by the integer i, whi...
instruction
0
60,757
14
121,514
Tags: greedy, implementation Correct Solution: ``` n = int(input()) array = list(map(int, input().split())) days, flag = 0, 1 ans, day, arrived = [], set(), set() for i in array: if i > 0: if i in arrived: flag = 0 break else: day.add(i) arrived.add(i)...
output
1
60,757
14
121,515
Provide tags and a correct Python 3 solution for this coding contest problem. The Central Company has an office with a sophisticated security system. There are 10^6 employees, numbered from 1 to 10^6. The security system logs entrances and departures. The entrance of the i-th employee is denoted by the integer i, whi...
instruction
0
60,758
14
121,516
Tags: greedy, implementation Correct Solution: ``` input() t={0} i=s=0 r=[0] for x in map(int, input().split()): if(x>0)&(x in t)|(x<0)^(-abs(x)in t):r=-1,;break if x>0:t|={x,-x} else:t-={x} i+=1;s+=x if s==0:r[0]+=1;r+=i,;t={0};i=0 if s:r=-1, print(r[0]) print(*r[1:]) ```
output
1
60,758
14
121,517
Provide tags and a correct Python 3 solution for this coding contest problem. The Central Company has an office with a sophisticated security system. There are 10^6 employees, numbered from 1 to 10^6. The security system logs entrances and departures. The entrance of the i-th employee is denoted by the integer i, whi...
instruction
0
60,759
14
121,518
Tags: greedy, implementation Correct Solution: ``` a = int(input()) b = list(map(int, input().split())) def solve(a,b): checkedin = set() blocked = set() ans = [] if a % 2 != 0: return -1 for i in b: if i > 0: if i in blocked or i in checkedin: return -1 ...
output
1
60,759
14
121,519
Provide tags and a correct Python 3 solution for this coding contest problem. The Central Company has an office with a sophisticated security system. There are 10^6 employees, numbered from 1 to 10^6. The security system logs entrances and departures. The entrance of the i-th employee is denoted by the integer i, whi...
instruction
0
60,760
14
121,520
Tags: greedy, implementation Correct Solution: ``` n=int(input()) l=list(map(int,input().split())) a=[0]*(10**6+1) use={} ans=[0] t=0 false=0 for i in range(n): if l[i]>0: if l[i] not in use: a[l[i]]=1 t+=1 use[l[i]]=1 else: false=1 break if l[i]<0: if a[-l[i]]==1: a[-l[i]]=0 t-=1 else: ...
output
1
60,760
14
121,521
Provide tags and a correct Python 3 solution for this coding contest problem. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to each other. Each pair of blogs that are connect...
instruction
0
60,817
14
121,634
Tags: constructive algorithms, graphs, greedy, sortings Correct Solution: ``` import sys input = sys.stdin.buffer.readline n, m = map(int, input().split()) info = [list(map(int, input().split())) for i in range(m)] t = list(map(int, input().split())) graph = [[] for i in range(n)] for a, b in info: a -= 1 b...
output
1
60,817
14
121,635
Provide tags and a correct Python 3 solution for this coding contest problem. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to each other. Each pair of blogs that are connect...
instruction
0
60,818
14
121,636
Tags: constructive algorithms, graphs, greedy, sortings Correct Solution: ``` import sys import io, os input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline from collections import defaultdict graph=defaultdict(list) n,m=map(int,input().split()) for i in range(m): a,b=map(int,input().split()) graph[a].app...
output
1
60,818
14
121,637
Provide tags and a correct Python 3 solution for this coding contest problem. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to each other. Each pair of blogs that are connect...
instruction
0
60,819
14
121,638
Tags: constructive algorithms, graphs, greedy, sortings Correct Solution: ``` import sys import os,io def read_list(): return list(map(int,input().split(' '))) def print_list(l): print(' '.join(map(str,l))) # import heapq # import bisect # from collections import deque from collections import defaultdict # import m...
output
1
60,819
14
121,639
Provide tags and a correct Python 3 solution for this coding contest problem. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to each other. Each pair of blogs that are connect...
instruction
0
60,820
14
121,640
Tags: constructive algorithms, graphs, greedy, sortings Correct Solution: ``` import sys input=sys.stdin.buffer.readline #3 3 #1 2 #2 3 #3 1 #1 1 1 #n=2 #test n,m=[int(x) for x in input().split()] neighbours=dict() #[blog:[neighbouring blogs]] maxInNeighbours=dict() #{blog:max in neighbours so far} for i in range...
output
1
60,820
14
121,641
Provide tags and a correct Python 3 solution for this coding contest problem. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to each other. Each pair of blogs that are connect...
instruction
0
60,821
14
121,642
Tags: constructive algorithms, graphs, greedy, sortings Correct Solution: ``` import sys r=sys.stdin.buffer.readline n,m=map(int,r().split()) network=[[] for _ in range(n)] for _ in range(m): a,b=map(int,r().split()) network[a-1].append(b-1) network[b-1].append(a-1) lst=list(map(int,r().split())) arr=list(r...
output
1
60,821
14
121,643
Provide tags and a correct Python 3 solution for this coding contest problem. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to each other. Each pair of blogs that are connect...
instruction
0
60,822
14
121,644
Tags: constructive algorithms, graphs, greedy, sortings Correct Solution: ``` import io, os input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline def f(): n, m = [int(s) for s in input().split()] neibors = [[] for _ in range(n)] for _ in range(m): a, b = [int(s)-1 for s in input().split()] ...
output
1
60,822
14
121,645
Provide tags and a correct Python 3 solution for this coding contest problem. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to each other. Each pair of blogs that are connect...
instruction
0
60,823
14
121,646
Tags: constructive algorithms, graphs, greedy, sortings Correct Solution: ``` import sys import io, os input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline def main(): n, m = map(int,input().split()) G = [[] for k in range(n)] for k in range(m): a, b = map(int,input().split()) G[a-1]....
output
1
60,823
14
121,647
Provide tags and a correct Python 3 solution for this coding contest problem. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to each other. Each pair of blogs that are connect...
instruction
0
60,824
14
121,648
Tags: constructive algorithms, graphs, greedy, sortings Correct Solution: ``` import sys input=sys.stdin.buffer.readline n,m=[int(x) for x in input().split()] neighbours=dict() #[blog:[neighbouring blogs]] for i in range(1,n+1): neighbours[i]=[] for _ in range(m): a,b=[int(x) for x in input().split()] #b...
output
1
60,824
14
121,649
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to ...
instruction
0
60,825
14
121,650
Yes
output
1
60,825
14
121,651
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to ...
instruction
0
60,826
14
121,652
Yes
output
1
60,826
14
121,653
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to ...
instruction
0
60,827
14
121,654
Yes
output
1
60,827
14
121,655
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to ...
instruction
0
60,828
14
121,656
Yes
output
1
60,828
14
121,657
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to ...
instruction
0
60,829
14
121,658
No
output
1
60,829
14
121,659
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to ...
instruction
0
60,830
14
121,660
No
output
1
60,830
14
121,661
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to ...
instruction
0
60,831
14
121,662
No
output
1
60,831
14
121,663
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to ...
instruction
0
60,832
14
121,664
No
output
1
60,832
14
121,665
Provide tags and a correct Python 3 solution for this coding contest problem. In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks. More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(gcd(a,b)), (b)/(gcd(a,b)) can form sides of a t...
instruction
0
60,865
14
121,730
Tags: binary search, math, number theory, two pointers Correct Solution: ``` import io,os,sys input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline import math def upper_bound(nums, target): l, r = 0, len(nums) - 1 while l <= r: mid = l + (r - l) // 2 if nums[mid] > target: r ...
output
1
60,865
14
121,731
Provide tags and a correct Python 3 solution for this coding contest problem. In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks. More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(gcd(a,b)), (b)/(gcd(a,b)) can form sides of a t...
instruction
0
60,866
14
121,732
Tags: binary search, math, number theory, two pointers Correct Solution: ``` import sys, os, io def rs(): return sys.stdin.readline().rstrip() def ri(): return int(sys.stdin.readline()) def ria(): return list(map(int, sys.stdin.readline().split())) def ws(s): sys.stdout.write(s + '\n') def wi(n): sys.stdout.write(str(n...
output
1
60,866
14
121,733
Provide tags and a correct Python 3 solution for this coding contest problem. In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks. More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(gcd(a,b)), (b)/(gcd(a,b)) can form sides of a t...
instruction
0
60,867
14
121,734
Tags: binary search, math, number theory, two pointers Correct Solution: ``` import io,os,sys input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline import math def upper_bound(nums, target): l, r = 0, len(nums) - 1 while l <= r: mid = l + (r - l) // 2 if nums[mid] > target: r ...
output
1
60,867
14
121,735
Provide tags and a correct Python 3 solution for this coding contest problem. In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks. More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(gcd(a,b)), (b)/(gcd(a,b)) can form sides of a t...
instruction
0
60,868
14
121,736
Tags: binary search, math, number theory, two pointers Correct Solution: ``` import math import sys import os import sys from io import BytesIO, IOBase from types import GeneratorType from collections import defaultdict BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self....
output
1
60,868
14
121,737
Provide tags and a correct Python 3 solution for this coding contest problem. In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks. More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(gcd(a,b)), (b)/(gcd(a,b)) can form sides of a t...
instruction
0
60,870
14
121,740
Tags: binary search, math, number theory, two pointers Correct Solution: ``` import math import sys from io import BytesIO, IOBase BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): import os self.os = os self._fd = file.fileno() self.buffer = BytesIO(...
output
1
60,870
14
121,741
Provide tags and a correct Python 3 solution for this coding contest problem. In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks. More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(gcd(a,b)), (b)/(gcd(a,b)) can form sides of a t...
instruction
0
60,871
14
121,742
Tags: binary search, math, number theory, two pointers Correct Solution: ``` import os import sys from io import BytesIO, IOBase import math import bisect import heapq def main(): pass BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = file.fileno() s...
output
1
60,871
14
121,743
Provide tags and a correct Python 3 solution for this coding contest problem. In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks. More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(gcd(a,b)), (b)/(gcd(a,b)) can form sides of a t...
instruction
0
60,872
14
121,744
Tags: binary search, math, number theory, two pointers Correct Solution: ``` import os import sys from io import BytesIO, IOBase # region fastio BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = file.fileno() self.buffer = BytesIO() self.writable = ...
output
1
60,872
14
121,745
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks. More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(...
instruction
0
60,873
14
121,746
Yes
output
1
60,873
14
121,747
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks. More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(...
instruction
0
60,874
14
121,748
Yes
output
1
60,874
14
121,749
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks. More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(...
instruction
0
60,877
14
121,754
No
output
1
60,877
14
121,755
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks. More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(...
instruction
0
60,879
14
121,758
No
output
1
60,879
14
121,759
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks. More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(...
instruction
0
60,880
14
121,760
No
output
1
60,880
14
121,761
Provide tags and a correct Python 3 solution for this coding contest problem. Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several c...
instruction
0
61,110
14
122,220
Tags: implementation, number theory Correct Solution: ``` n = int(input()) petals = list(map(int, input().split())) odd = 0 for i in range(n): petals = sorted(petals) if petals[i] % 2 != 0: odd = petals[i] break if sum(petals)%2==0: if odd == 0: print(0) else: print(sum(p...
output
1
61,110
14
122,221
Provide tags and a correct Python 3 solution for this coding contest problem. Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several c...
instruction
0
61,111
14
122,222
Tags: implementation, number theory Correct Solution: ``` y=(input()) x=list(map(int,input().split())) even=[] odd=[] for i in x: if i%2==0: even+=[i] else: odd+=[i] w=0 if sum(x)%2==1: w=sum(x) else: if len(odd)>=1: odd.sort() w=sum(even)+sum(odd[1:]) print...
output
1
61,111
14
122,223
Provide tags and a correct Python 3 solution for this coding contest problem. Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several c...
instruction
0
61,112
14
122,224
Tags: implementation, number theory Correct Solution: ``` import sys from array import array # noqa: F401 def input(): return sys.stdin.buffer.readline().decode('utf-8') n = int(input()) a = list(map(int, input().split())) odd, even = [], [] for x in a: if x % 2: odd.append(x) else: eve...
output
1
61,112
14
122,225