message stringlengths 2 20.2k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 757 108k | cluster float64 4 4 | __index_level_0__ int64 1.51k 217k |
|---|---|---|---|---|---|
Provide a correct Python 3 solution for this coding contest problem.
As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Japan.
The other calendar system is era-based calendar, o... | instruction | 0 | 38,546 | 4 | 77,092 |
"Correct Solution:
```
while True:
Name=[]
first=[]
final=[]
N,Q =map(int,input().split())
if N==Q==0:
break
else:
for n in range(N):
eraname,erabasedyear,westernyear=input().split()
Name.append(eraname)
era_first=int(westernyear) - int(erabasedyear) +1
first.append(int(era_f... | output | 1 | 38,546 | 4 | 77,093 |
Provide a correct Python 3 solution for this coding contest problem.
As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Japan.
The other calendar system is era-based calendar, o... | instruction | 0 | 38,547 | 4 | 77,094 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15
def solve(N,Q):
era = []
for _ in range(N):
X = input().split()
name = X[0]
y = int(X[1])
w = int(X[2])
era.append((w - y + 1,w,name))
for _ in range(Q):
flag ... | output | 1 | 38,547 | 4 | 77,095 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Ja... | instruction | 0 | 38,548 | 4 | 77,096 |
Yes | output | 1 | 38,548 | 4 | 77,097 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Ja... | instruction | 0 | 38,549 | 4 | 77,098 |
Yes | output | 1 | 38,549 | 4 | 77,099 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Ja... | instruction | 0 | 38,550 | 4 | 77,100 |
Yes | output | 1 | 38,550 | 4 | 77,101 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Ja... | instruction | 0 | 38,551 | 4 | 77,102 |
Yes | output | 1 | 38,551 | 4 | 77,103 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Ja... | instruction | 0 | 38,552 | 4 | 77,104 |
No | output | 1 | 38,552 | 4 | 77,105 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Ja... | instruction | 0 | 38,553 | 4 | 77,106 |
No | output | 1 | 38,553 | 4 | 77,107 |
Provide a correct Python 3 solution for this coding contest problem.
We have an analog clock whose three hands (the second hand, the minute hand and the hour hand) rotate quite smoothly. You can measure two angles between the second hand and two other hands.
Write a program to find the time at which "No two hands ove... | instruction | 0 | 39,558 | 4 | 79,116 |
"Correct Solution:
```
import sys
def gcd(m, n):
while n:
m, n = n, m % n
return m
readline = sys.stdin.readline
write = sys.stdout.write
def solve():
f = lambda h, m, s: 3600*h + 60*m + s
H, h, m, s = map(int, readline().split())
if H == 0:
return False
d0 = f(h, m, s)
M = f... | output | 1 | 39,558 | 4 | 79,117 |
Provide a correct Python 3 solution for this coding contest problem.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B ... | instruction | 0 | 41,085 | 4 | 82,170 |
"Correct Solution:
```
[A,B]=list(map(int,input().split()))
print((A+B)%24)
``` | output | 1 | 41,085 | 4 | 82,171 |
Provide a correct Python 3 solution for this coding contest problem.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B ... | instruction | 0 | 41,086 | 4 | 82,172 |
"Correct Solution:
```
import math
a,b = map(int, input().split())
print(abs(a + b) % 24)
``` | output | 1 | 41,086 | 4 | 82,173 |
Provide a correct Python 3 solution for this coding contest problem.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B ... | instruction | 0 | 41,087 | 4 | 82,174 |
"Correct Solution:
```
A, B = list(map(int, input().split()))
T = (A + B) % 24
print(T)
``` | output | 1 | 41,087 | 4 | 82,175 |
Provide a correct Python 3 solution for this coding contest problem.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B ... | instruction | 0 | 41,088 | 4 | 82,176 |
"Correct Solution:
```
print(sum([int(i) for i in input().split()]) % 24)
``` | output | 1 | 41,088 | 4 | 82,177 |
Provide a correct Python 3 solution for this coding contest problem.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B ... | instruction | 0 | 41,089 | 4 | 82,178 |
"Correct Solution:
```
a, b = map(int, input().split())
A = a+b
B = A%24
print(B)
``` | output | 1 | 41,089 | 4 | 82,179 |
Provide a correct Python 3 solution for this coding contest problem.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B ... | instruction | 0 | 41,090 | 4 | 82,180 |
"Correct Solution:
```
a,b = map(int,input().split())
r = (24+a+b)%24
print(r)
``` | output | 1 | 41,090 | 4 | 82,181 |
Provide a correct Python 3 solution for this coding contest problem.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B ... | instruction | 0 | 41,091 | 4 | 82,182 |
"Correct Solution:
```
#2019/09/24
A, B = map(int, input().split())
print((A + B) % 24)
``` | output | 1 | 41,091 | 4 | 82,183 |
Provide a correct Python 3 solution for this coding contest problem.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B ... | instruction | 0 | 41,092 | 4 | 82,184 |
"Correct Solution:
```
t1,t2 = list(map(int,input().strip().split()))
print((t1+t2)%24)
``` | output | 1 | 41,092 | 4 | 82,185 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current t... | instruction | 0 | 41,093 | 4 | 82,186 |
Yes | output | 1 | 41,093 | 4 | 82,187 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current t... | instruction | 0 | 41,094 | 4 | 82,188 |
Yes | output | 1 | 41,094 | 4 | 82,189 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current t... | instruction | 0 | 41,095 | 4 | 82,190 |
Yes | output | 1 | 41,095 | 4 | 82,191 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current t... | instruction | 0 | 41,096 | 4 | 82,192 |
Yes | output | 1 | 41,096 | 4 | 82,193 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current t... | instruction | 0 | 41,097 | 4 | 82,194 |
No | output | 1 | 41,097 | 4 | 82,195 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current t... | instruction | 0 | 41,098 | 4 | 82,196 |
No | output | 1 | 41,098 | 4 | 82,197 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current t... | instruction | 0 | 41,099 | 4 | 82,198 |
No | output | 1 | 41,099 | 4 | 82,199 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".
The current t... | instruction | 0 | 41,100 | 4 | 82,200 |
No | output | 1 | 41,100 | 4 | 82,201 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n are used, i.e. there is no time "0 hours", inst... | instruction | 0 | 41,816 | 4 | 83,632 |
Tags: binary search, two pointers
Correct Solution:
```
n = int(input())
a = [int(i) for i in input().split()]
s, f = [int(i) for i in input().split()]
a = a + a
ln = f - s
ans = sum(a[:ln])
mx = ans
h = s
for i in range(n - 1):
ans = ans - a[i] + a[i + ln]
if ans > mx:
ans = mx
k = s + (n - (i ... | output | 1 | 41,816 | 4 | 83,633 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n are used, i.e. there is no time "0 hours", inst... | instruction | 0 | 41,817 | 4 | 83,634 |
Tags: binary search, two pointers
Correct Solution:
```
n = int(input())
a = [int(i) for i in input().split(' ')]
s, f = [int(i) for i in input().split(' ')]
m = sum(a[i] for i in range(s - 1, f - 1))
current, time = m, 0
for i in range(n):
current = current - a[(s - 1 + i) % n] + a[(f - 1 + i) % n]
if current... | output | 1 | 41,817 | 4 | 83,635 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n are used, i.e. there is no time "0 hours", inst... | instruction | 0 | 41,818 | 4 | 83,636 |
Tags: binary search, two pointers
Correct Solution:
```
n = int(input())
a = list(map(int, input().split()))
s, f = map(int, input().split())
s -= 1
f -= 1
best_sum = sum(a[s:f])
best_i = 0
cur_sum = best_sum
for i in range(1, n):
cur_sum += a[(s - i + n) % n]
cur_sum -= a[(f - i + n) % n]
if cur_sum > best... | output | 1 | 41,818 | 4 | 83,637 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n are used, i.e. there is no time "0 hours", inst... | instruction | 0 | 41,819 | 4 | 83,638 |
Tags: binary search, two pointers
Correct Solution:
```
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 7 23:03:41 2018
@author: Paras Sharma
"""
n=int(input())
l=list(map(int,input().split()))
s,e=list(map(int,input().split()))
t=e-s
curr=sum(l[:t-1])
#print(curr)
newl=[]
for i in range(t-1,n+t-1):
#print(i)
... | output | 1 | 41,819 | 4 | 83,639 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n are used, i.e. there is no time "0 hours", inst... | instruction | 0 | 41,820 | 4 | 83,640 |
Tags: binary search, two pointers
Correct Solution:
```
# cook your dish here
n = int(input())
a = list(map(int, input().split()))
s, f = map(int, input().split())
def conv(i, n, s):
return ( s - (i - 1) ) % n
d = {}
sm = 0
diff = f - s
for i in range(diff):
sm+=a[i]
for i in range(n):
tm = conv(i+1, n, ... | output | 1 | 41,820 | 4 | 83,641 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n are used, i.e. there is no time "0 hours", inst... | instruction | 0 | 41,821 | 4 | 83,642 |
Tags: binary search, two pointers
Correct Solution:
```
n = int(input())
l = list(map(int,input().split()))
s,f = map(int,input().split())
pref = [0]
for i in l:
pref.append(i+pref[-1])
f-=1
maxi = 0
ha = 1
ans = 0
# print(pref)
while ha<=n:
if f>=s:
sumi = pref[f]-pref[s-1]
else:
sumi = pref... | output | 1 | 41,821 | 4 | 83,643 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n are used, i.e. there is no time "0 hours", inst... | instruction | 0 | 41,822 | 4 | 83,644 |
Tags: binary search, two pointers
Correct Solution:
```
n = int(input())
lst = []
for x in input().split():
lst.append(int(x))
s, f = map(int, input().split())
s -= 1
f -= 1
best_sum = sum(lst[s:f])
best_i = 0
cur_sum = best_sum
for i in range(1, n):
cur_sum += lst[(s - i + n) % n]
cur_sum -= lst[(f ... | output | 1 | 41,822 | 4 | 83,645 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n are used, i.e. there is no time "0 hours", inst... | instruction | 0 | 41,823 | 4 | 83,646 |
Tags: binary search, two pointers
Correct Solution:
```
def main():
n = int(input())
a = [int(x) for x in input().split()]
a += a
s, f = [int(x) for x in input().split()]
dp = [0 for _ in range(2 * n + 1)]
for i in range(2 * n):
dp[i + 1] = dp[i] + a[i]
ans, sum = 0, 0
for i... | output | 1 | 41,823 | 4 | 83,647 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n ... | instruction | 0 | 41,824 | 4 | 83,648 |
Yes | output | 1 | 41,824 | 4 | 83,649 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n ... | instruction | 0 | 41,825 | 4 | 83,650 |
Yes | output | 1 | 41,825 | 4 | 83,651 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n ... | instruction | 0 | 41,826 | 4 | 83,652 |
Yes | output | 1 | 41,826 | 4 | 83,653 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n ... | instruction | 0 | 41,827 | 4 | 83,654 |
Yes | output | 1 | 41,827 | 4 | 83,655 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n ... | instruction | 0 | 41,828 | 4 | 83,656 |
No | output | 1 | 41,828 | 4 | 83,657 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n ... | instruction | 0 | 41,829 | 4 | 83,658 |
No | output | 1 | 41,829 | 4 | 83,659 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n ... | instruction | 0 | 41,830 | 4 | 83,660 |
No | output | 1 | 41,830 | 4 | 83,661 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In distant future on Earth day lasts for n hours and that's why there are n timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to n ... | instruction | 0 | 41,831 | 4 | 83,662 |
No | output | 1 | 41,831 | 4 | 83,663 |
Provide a correct Python 3 solution for this coding contest problem.
Taro's summer vacation starts tomorrow, and he has decided to make plans for it now.
The vacation consists of N days. For each i (1 \leq i \leq N), Taro will choose one of the following activities and do it on the i-th day:
* A: Swim in the sea. Ga... | instruction | 0 | 41,877 | 4 | 83,754 |
"Correct Solution:
```
N = int(input())
ABC = [[int(_) for _ in input().split()] for _ in range(N)]
dp = [0, 0, 0]
for a, b, c in ABC:
dp = [a + max(dp[1:]), b + max([dp[0], dp[2]]), c + max(dp[:2])]
print(max(dp))
``` | output | 1 | 41,877 | 4 | 83,755 |
Provide a correct Python 3 solution for this coding contest problem.
Taro's summer vacation starts tomorrow, and he has decided to make plans for it now.
The vacation consists of N days. For each i (1 \leq i \leq N), Taro will choose one of the following activities and do it on the i-th day:
* A: Swim in the sea. Ga... | instruction | 0 | 41,878 | 4 | 83,756 |
"Correct Solution:
```
n, *t = map( int, open( 0 ).read().split() )
# manemane
A, B, C = 0, 0, 0
for i in range( n ):
A, B, C = t[ 3 * i ] + max( B, C ), t[ 3 * i + 1 ] + max( A, C ), t[ 3 * i + 2 ] + max( A, B )
print( max( A, B, C ) )
``` | output | 1 | 41,878 | 4 | 83,757 |
Provide a correct Python 3 solution for this coding contest problem.
Taro's summer vacation starts tomorrow, and he has decided to make plans for it now.
The vacation consists of N days. For each i (1 \leq i \leq N), Taro will choose one of the following activities and do it on the i-th day:
* A: Swim in the sea. Ga... | instruction | 0 | 41,879 | 4 | 83,758 |
"Correct Solution:
```
n=int(input())
V=[[0]*3 for i in range(2)]
d=1
e=0
for i in range(n):
a,b,c=map(int,input().split())
V[d][0]=max(V[e][1],V[e][2])+a
V[d][1]=max(V[e][2],V[e][0])+b
V[d][2]=max(V[e][0],V[e][1])+c
d=e
e=(e+1)%2
print(max(V[e][0],V[e][1],V[e][2]))
``` | output | 1 | 41,879 | 4 | 83,759 |
Provide a correct Python 3 solution for this coding contest problem.
Taro's summer vacation starts tomorrow, and he has decided to make plans for it now.
The vacation consists of N days. For each i (1 \leq i \leq N), Taro will choose one of the following activities and do it on the i-th day:
* A: Swim in the sea. Ga... | instruction | 0 | 41,880 | 4 | 83,760 |
"Correct Solution:
```
N = int(input())
dp = [0, 0, 0]
for i in range(N):
a, b, c = map(int, input().split())
tmp_a = a + max(dp[1], dp[2])
tmp_b = b + max(dp[0], dp[2])
tmp_c = c + max(dp[0], dp[1])
dp = [tmp_a, tmp_b, tmp_c]
print(max(dp))
``` | output | 1 | 41,880 | 4 | 83,761 |
Provide a correct Python 3 solution for this coding contest problem.
Taro's summer vacation starts tomorrow, and he has decided to make plans for it now.
The vacation consists of N days. For each i (1 \leq i \leq N), Taro will choose one of the following activities and do it on the i-th day:
* A: Swim in the sea. Ga... | instruction | 0 | 41,881 | 4 | 83,762 |
"Correct Solution:
```
N = int(input())
wa, wb, wc = [0] * 3
for a, b, c in (map(int, input().split()) for _ in range(N)):
wa, wb, wc = a + max(wb, wc), b + max(wa, wc), c + max(wa, wb)
print(max(wa, wb, wc))
``` | output | 1 | 41,881 | 4 | 83,763 |
Provide a correct Python 3 solution for this coding contest problem.
Taro's summer vacation starts tomorrow, and he has decided to make plans for it now.
The vacation consists of N days. For each i (1 \leq i \leq N), Taro will choose one of the following activities and do it on the i-th day:
* A: Swim in the sea. Ga... | instruction | 0 | 41,882 | 4 | 83,764 |
"Correct Solution:
```
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
dp=[[0 for i in range(3)] for j in range(n+1)]
dp[1]=l[0]
for i in range(2,n+1):
for j in range(3):
dp[i][j]=max(dp[i-1][j-1],dp[i-1][j-2])+l[i-1][j]
print(max(dp[-1]))
``` | output | 1 | 41,882 | 4 | 83,765 |
Provide a correct Python 3 solution for this coding contest problem.
Taro's summer vacation starts tomorrow, and he has decided to make plans for it now.
The vacation consists of N days. For each i (1 \leq i \leq N), Taro will choose one of the following activities and do it on the i-th day:
* A: Swim in the sea. Ga... | instruction | 0 | 41,883 | 4 | 83,766 |
"Correct Solution:
```
N = int(input())
la, lb, lc = [0] * 3
for i in range(N):
a, b, c = [int(x) for x in input().split()]
aa = a + max(lb, lc)
bb = b + max(lc, la)
cc = c + max(lb, la)
la = aa
lb = bb
lc = cc
print(max(la, lb, lc))
``` | output | 1 | 41,883 | 4 | 83,767 |
Provide a correct Python 3 solution for this coding contest problem.
Taro's summer vacation starts tomorrow, and he has decided to make plans for it now.
The vacation consists of N days. For each i (1 \leq i \leq N), Taro will choose one of the following activities and do it on the i-th day:
* A: Swim in the sea. Ga... | instruction | 0 | 41,884 | 4 | 83,768 |
"Correct Solution:
```
N=int(input())
abc=[list(map(int,input().split())) for i in range(N)]
x,y,z = 0,0,0
for a,b,c in abc:
x,y,z = max(y,z)+a,max(x,z)+b,max(x,y)+c
print(max(x,y,z))
``` | output | 1 | 41,884 | 4 | 83,769 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Taro's summer vacation starts tomorrow, and he has decided to make plans for it now.
The vacation consists of N days. For each i (1 \leq i \leq N), Taro will choose one of the following activit... | instruction | 0 | 41,885 | 4 | 83,770 |
Yes | output | 1 | 41,885 | 4 | 83,771 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.