message stringlengths 2 22.7k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 145 109k | cluster float64 9 9 | __index_level_0__ int64 290 217k |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
Ann and Borya have n piles with candies and n is even number. There are ai candies in pile with number i.
Ann likes numbers which are square of some integer and Borya doesn't like numbers which are square of any integer. During one move guy... | instruction | 0 | 81,394 | 9 | 162,788 |
Tags: constructive algorithms, greedy
Correct Solution:
```
from math import sqrt
def check(x):
sq = int(sqrt(x))
while sq * sq < x:
sq += 1
return sq * sq == x, sq
n = int(input())
a = map(int, input().split())
sq, non_sq = 0, 0
sqs, non_sqs = [], []
for _ in a:
res, root = check(_)
sq +=... | output | 1 | 81,394 | 9 | 162,789 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ann and Borya have n piles with candies and n is even number. There are ai candies in pile with number i.
Ann likes numbers which are square of some integer and Borya doesn't like numbers which are square of any integer. During one move guy... | instruction | 0 | 81,395 | 9 | 162,790 |
Tags: constructive algorithms, greedy
Correct Solution:
```
sq=[i*i for i in range(10**5+5)]
a=[]
nules=0
ap=a.append
from bisect import bisect_left
n=int(input())//2
for i in map(int,input().split()):
if i==0:
ap(0)
nules+=1
else:
ind=bisect_left(sq,i)
#print(ind)
ap(min... | output | 1 | 81,395 | 9 | 162,791 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ann and Borya have n piles with candies and n is even number. There are ai candies in pile with number i.
Ann likes numbers which are square of some integer and Borya doesn't like numbers which... | instruction | 0 | 81,396 | 9 | 162,792 |
Yes | output | 1 | 81,396 | 9 | 162,793 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ann and Borya have n piles with candies and n is even number. There are ai candies in pile with number i.
Ann likes numbers which are square of some integer and Borya doesn't like numbers which... | instruction | 0 | 81,397 | 9 | 162,794 |
Yes | output | 1 | 81,397 | 9 | 162,795 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ann and Borya have n piles with candies and n is even number. There are ai candies in pile with number i.
Ann likes numbers which are square of some integer and Borya doesn't like numbers which... | instruction | 0 | 81,398 | 9 | 162,796 |
Yes | output | 1 | 81,398 | 9 | 162,797 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ann and Borya have n piles with candies and n is even number. There are ai candies in pile with number i.
Ann likes numbers which are square of some integer and Borya doesn't like numbers which... | instruction | 0 | 81,399 | 9 | 162,798 |
Yes | output | 1 | 81,399 | 9 | 162,799 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ann and Borya have n piles with candies and n is even number. There are ai candies in pile with number i.
Ann likes numbers which are square of some integer and Borya doesn't like numbers which... | instruction | 0 | 81,400 | 9 | 162,800 |
No | output | 1 | 81,400 | 9 | 162,801 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ann and Borya have n piles with candies and n is even number. There are ai candies in pile with number i.
Ann likes numbers which are square of some integer and Borya doesn't like numbers which... | instruction | 0 | 81,401 | 9 | 162,802 |
No | output | 1 | 81,401 | 9 | 162,803 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ann and Borya have n piles with candies and n is even number. There are ai candies in pile with number i.
Ann likes numbers which are square of some integer and Borya doesn't like numbers which... | instruction | 0 | 81,402 | 9 | 162,804 |
No | output | 1 | 81,402 | 9 | 162,805 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ann and Borya have n piles with candies and n is even number. There are ai candies in pile with number i.
Ann likes numbers which are square of some integer and Borya doesn't like numbers which... | instruction | 0 | 81,403 | 9 | 162,806 |
No | output | 1 | 81,403 | 9 | 162,807 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
* it can contain a single sticker and no toy;
... | instruction | 0 | 81,790 | 9 | 163,580 |
Tags: math
Correct Solution:
```
T = int(input())
for counter in range(T):
n, s, t = [int(i) for i in input().split()]
print(n - min(s, t) + 1)
``` | output | 1 | 81,790 | 9 | 163,581 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
* it can contain a single sticker and no toy;
... | instruction | 0 | 81,791 | 9 | 163,582 |
Tags: math
Correct Solution:
```
"""
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that
exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
it can contain a single sticker and no toy;
it can contain a single toy and no stic... | output | 1 | 81,791 | 9 | 163,583 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
* it can contain a single sticker and no toy;
... | instruction | 0 | 81,792 | 9 | 163,584 |
Tags: math
Correct Solution:
```
# -*- coding: utf-8 -*-
for _ in[0]*int(input()):
n,s,t = map(int,input().split(" "))
ans = max(n-s+1, n-t + 1)
print(ans)
``` | output | 1 | 81,792 | 9 | 163,585 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
* it can contain a single sticker and no toy;
... | instruction | 0 | 81,793 | 9 | 163,586 |
Tags: math
Correct Solution:
```
for _ in [0] * int(input()):
n, s, t = map(int, input().split())
print(1 if (s+t) // n == 2 else n - min(s, t) + 1)
``` | output | 1 | 81,793 | 9 | 163,587 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
* it can contain a single sticker and no toy;
... | instruction | 0 | 81,794 | 9 | 163,588 |
Tags: math
Correct Solution:
```
test=int(input())
while(test>0):
test-=1
n,s,t=[int(x) for x in input().split()]
if(s+t==n):
if(s>t):
print(n-t+1)
else:
print(n-s+1)
else:
if(s==t):
print(n-s+1)
else:
if(s>t):
... | output | 1 | 81,794 | 9 | 163,589 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
* it can contain a single sticker and no toy;
... | instruction | 0 | 81,795 | 9 | 163,590 |
Tags: math
Correct Solution:
```
def f(i):
n,s,t = i
res = max(n-t,n-s)+1
return res
l = []
for _ in range(int(input())):
n,s,t = map(int,input().split())
l.append((n,s,t))
ans = [f(i) for i in l]
for i in ans :
print(i)
``` | output | 1 | 81,795 | 9 | 163,591 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
* it can contain a single sticker and no toy;
... | instruction | 0 | 81,796 | 9 | 163,592 |
Tags: math
Correct Solution:
```
import sys
import math
import re
from functools import reduce
n = int(input())
for _ in range(n):
n, s, t = map(int, sys.stdin.readline().split())
if s == t and s == n:
print(1)
elif s == t:
print(n - s + 1)
else:
print(n - min(s, t) + 1)
... | output | 1 | 81,796 | 9 | 163,593 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
* it can contain a single sticker and no toy;
... | instruction | 0 | 81,797 | 9 | 163,594 |
Tags: math
Correct Solution:
```
t=int(input())
for i in range(t):
n,s,t=list(map(int,input().split()))
b=s+t-n
s=s-b
t=t-b
print(max(s,t)+1)
``` | output | 1 | 81,797 | 9 | 163,595 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
... | instruction | 0 | 81,798 | 9 | 163,596 |
Yes | output | 1 | 81,798 | 9 | 163,597 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
... | instruction | 0 | 81,799 | 9 | 163,598 |
Yes | output | 1 | 81,799 | 9 | 163,599 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
... | instruction | 0 | 81,800 | 9 | 163,600 |
Yes | output | 1 | 81,800 | 9 | 163,601 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
... | instruction | 0 | 81,801 | 9 | 163,602 |
Yes | output | 1 | 81,801 | 9 | 163,603 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
... | instruction | 0 | 81,802 | 9 | 163,604 |
No | output | 1 | 81,802 | 9 | 163,605 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
... | instruction | 0 | 81,803 | 9 | 163,606 |
No | output | 1 | 81,803 | 9 | 163,607 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
... | instruction | 0 | 81,804 | 9 | 163,608 |
No | output | 1 | 81,804 | 9 | 163,609 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.
Each Kinder Surprise can be one of three types:
... | instruction | 0 | 81,805 | 9 | 163,610 |
No | output | 1 | 81,805 | 9 | 163,611 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will eat candy from left to right, and Bob β from rig... | instruction | 0 | 81,854 | 9 | 163,708 |
Tags: implementation
Correct Solution:
```
t=int(input())
for w in range(t):
n=int(input())
arr=list(map(int,input().strip().split()))
sum2=moves=sum1=i=0
j=n-1
a=[]
b=[]
while j>=i:
sum1=0
while sum1<=sum2 and i<=j:
p=arr[i]
sum1+=p
a.appe... | output | 1 | 81,854 | 9 | 163,709 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will eat candy from left to right, and Bob β from rig... | instruction | 0 | 81,855 | 9 | 163,710 |
Tags: implementation
Correct Solution:
```
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# . ' Udit Gupta @luctivud ,
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... | output | 1 | 81,855 | 9 | 163,711 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will eat candy from left to right, and Bob β from rig... | instruction | 0 | 81,856 | 9 | 163,712 |
Tags: implementation
Correct Solution:
```
for _ in range(int(input())):
n=int(input())
arr=list(map(int,input().split()))
d=0
c=0
al=0
mi=0
bo=0
k=n-1
m=0
f=0
while(d==0):
su=0
f=1
if(c%2==0):
for i in range(m,k+1):
su=su+a... | output | 1 | 81,856 | 9 | 163,713 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will eat candy from left to right, and Bob β from rig... | instruction | 0 | 81,857 | 9 | 163,714 |
Tags: implementation
Correct Solution:
```
times = int(input())
for i in range(times):
length = int(input())
array = input().split()
num = [int(x) for x in array]
alice = 0
bob = 0
moves = 0
a = 0
b = 0
flag = 0
while(len(num)>0):
flag = 0
alice = 0
wh... | output | 1 | 81,857 | 9 | 163,715 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will eat candy from left to right, and Bob β from rig... | instruction | 0 | 81,858 | 9 | 163,716 |
Tags: implementation
Correct Solution:
```
from collections import deque
n=int(input())
for i in range(n):
x=int(input())
l=deque(list(map(int,input().split())))
if x==1:
print(1,l[0],0)
elif x==2:
print(2,l[0],l[-1])
else:
c1=0
al=0
bob=0
c=0
... | output | 1 | 81,858 | 9 | 163,717 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will eat candy from left to right, and Bob β from rig... | instruction | 0 | 81,859 | 9 | 163,718 |
Tags: implementation
Correct Solution:
```
t=int(input())
for _ in range(t):
n=int(input())
arr=list(map(int,input().split()))
sb=0
count=1
a=arr.pop(0)
sa=a
b=0
while(len(arr)!=0):
if(a>b):
b=0
while(b<a+1):
b+=arr[len(arr)-1]
arr.pop()
if(len(arr)==0):
break
sb+=b
else:
a=0
... | output | 1 | 81,859 | 9 | 163,719 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will eat candy from left to right, and Bob β from rig... | instruction | 0 | 81,860 | 9 | 163,720 |
Tags: implementation
Correct Solution:
```
for _ in range(int(input())):
n = int(input())
a = list(map(int,input().split()))
i = 0
j = n-1
moves = 0
ta = 0
tb = 0
pa = 0
pb = 0
flag = 1
while(i <= j):
first = second = False
while(flag == 1 and pa <= pb and i <... | output | 1 | 81,860 | 9 | 163,721 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will eat candy from left to right, and Bob β from rig... | instruction | 0 | 81,861 | 9 | 163,722 |
Tags: implementation
Correct Solution:
```
t = int(input())
while t > 0:
n = int(input())
a = [int(x) for x in input().split()]
al = 0
bo = 0
ct = 0
mv = 1
pre = a[0]
al += a[0]
ct += 1
a.pop(0)
while len(a) > 0:
cur = 0
if mv == 1:
while cur... | output | 1 | 81,861 | 9 | 163,723 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will e... | instruction | 0 | 81,862 | 9 | 163,724 |
Yes | output | 1 | 81,862 | 9 | 163,725 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will e... | instruction | 0 | 81,863 | 9 | 163,726 |
Yes | output | 1 | 81,863 | 9 | 163,727 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will e... | instruction | 0 | 81,864 | 9 | 163,728 |
Yes | output | 1 | 81,864 | 9 | 163,729 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will e... | instruction | 0 | 81,865 | 9 | 163,730 |
Yes | output | 1 | 81,865 | 9 | 163,731 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will e... | instruction | 0 | 81,866 | 9 | 163,732 |
No | output | 1 | 81,866 | 9 | 163,733 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will e... | instruction | 0 | 81,867 | 9 | 163,734 |
No | output | 1 | 81,867 | 9 | 163,735 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will e... | instruction | 0 | 81,868 | 9 | 163,736 |
No | output | 1 | 81,868 | 9 | 163,737 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is a_i.
Alice and Bob play an interesting and tasty game: they eat candy. Alice will e... | instruction | 0 | 81,869 | 9 | 163,738 |
No | output | 1 | 81,869 | 9 | 163,739 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a rectangular cake, represented as an r Γ c grid. Each cell either has an evil strawberry, or is empty. For example, a 3 Γ 4 cake may look as follows:
<image>
The cakeminator is going to eat the cake! Each time he eats, he ch... | instruction | 0 | 82,047 | 9 | 164,094 |
Tags: brute force, implementation
Correct Solution:
```
# Cakeminator
def cake(s):
ans = 0
for i, n in enumerate(s):
if 'S' in n:
continue
else:
s[i] = ['E'] * len(n)
ans += len(n)
x = list(zip(*s))
for i, n in enumerate(x):
if 'S' in n:
... | output | 1 | 82,047 | 9 | 164,095 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a rectangular cake, represented as an r Γ c grid. Each cell either has an evil strawberry, or is empty. For example, a 3 Γ 4 cake may look as follows:
<image>
The cakeminator is going to eat the cake! Each time he eats, he ch... | instruction | 0 | 82,048 | 9 | 164,096 |
Tags: brute force, implementation
Correct Solution:
```
import sys
import math
#to read string
get_string = lambda: sys.stdin.readline().strip()
#to read list of integers
get_int_list = lambda: list( map(int,sys.stdin.readline().strip().split()) )
#to read non spaced string and elements are integers to list of int
get... | output | 1 | 82,048 | 9 | 164,097 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a rectangular cake, represented as an r Γ c grid. Each cell either has an evil strawberry, or is empty. For example, a 3 Γ 4 cake may look as follows:
<image>
The cakeminator is going to eat the cake! Each time he eats, he ch... | instruction | 0 | 82,049 | 9 | 164,098 |
Tags: brute force, implementation
Correct Solution:
```
n,k =map(int,input().split())
a=[]
c=[]
x=0
d=0
for i in range (n):
a.append(input())
for i in range (n-1,-1,-1):
if not "S" in a[i]:
x+=len(a[i])
del a[i]
d+=1
for i in range (k):
b=[]
for j in range (n-d):
b.append... | output | 1 | 82,049 | 9 | 164,099 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a rectangular cake, represented as an r Γ c grid. Each cell either has an evil strawberry, or is empty. For example, a 3 Γ 4 cake may look as follows:
<image>
The cakeminator is going to eat the cake! Each time he eats, he ch... | instruction | 0 | 82,050 | 9 | 164,100 |
Tags: brute force, implementation
Correct Solution:
```
m, n = map(int,input().split(' '))
m_set = set()
n_set = set()
for a in range(m):
s = input()
for b, c in enumerate(s):
if c == 'S':
m_set.add(a)
n_set.add(b)
print(m * n - len(m_set) * len(n_set))
``` | output | 1 | 82,050 | 9 | 164,101 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a rectangular cake, represented as an r Γ c grid. Each cell either has an evil strawberry, or is empty. For example, a 3 Γ 4 cake may look as follows:
<image>
The cakeminator is going to eat the cake! Each time he eats, he ch... | instruction | 0 | 82,051 | 9 | 164,102 |
Tags: brute force, implementation
Correct Solution:
```
r, c = map(int, input().split())
cake = []
eat = r * c
rows = set()
cols = set()
for i in range(r):
cake.append([i for i in input()])
for j, char in enumerate(cake[i]):
if (char == 'S'):
rows.add(i)
cols.add(j)
print (eat... | output | 1 | 82,051 | 9 | 164,103 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a rectangular cake, represented as an r Γ c grid. Each cell either has an evil strawberry, or is empty. For example, a 3 Γ 4 cake may look as follows:
<image>
The cakeminator is going to eat the cake! Each time he eats, he ch... | instruction | 0 | 82,052 | 9 | 164,104 |
Tags: brute force, implementation
Correct Solution:
```
r, c = [int(i) for i in input().split()]
a = []
ans = 0
h = r
for i in range(r):
cur = list(input().split()[0])
if 'S' not in cur:
ans+=c
h-=1
else:
a.append(cur)
a_t = list(zip(*a))
for elem in a_t:
if 'S' not in elem:
... | output | 1 | 82,052 | 9 | 164,105 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a rectangular cake, represented as an r Γ c grid. Each cell either has an evil strawberry, or is empty. For example, a 3 Γ 4 cake may look as follows:
<image>
The cakeminator is going to eat the cake! Each time he eats, he ch... | instruction | 0 | 82,053 | 9 | 164,106 |
Tags: brute force, implementation
Correct Solution:
```
class CodeforcesTask330ASolution:
def __init__(self):
self.result = ''
self.r_c = []
self.cake = []
def read_input(self):
self.r_c = [int(x) for x in input().split(" ")]
for r in range(self.r_c[0]):
self... | output | 1 | 82,053 | 9 | 164,107 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a rectangular cake, represented as an r Γ c grid. Each cell either has an evil strawberry, or is empty. For example, a 3 Γ 4 cake may look as follows:
<image>
The cakeminator is going to eat the cake! Each time he eats, he ch... | instruction | 0 | 82,054 | 9 | 164,108 |
Tags: brute force, implementation
Correct Solution:
```
r,c=map(int,input().strip().split())
l=[]
R=0
C=0
z=0
C1=set()
for i in range(r):
l.append(input())
if l[i].find('S',0)== -1:
z+=1
else:
R+=1
for i in range(r):
for j in range(c):
if l[i][j]=='S':
C1.add(j)
C=le... | output | 1 | 82,054 | 9 | 164,109 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.