message
stringlengths
2
22.8k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
16
109k
cluster
float64
1
1
__index_level_0__
int64
32
217k
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive int...
instruction
0
4,870
1
9,740
Yes
output
1
4,870
1
9,741
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive int...
instruction
0
4,871
1
9,742
No
output
1
4,871
1
9,743
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive int...
instruction
0
4,872
1
9,744
No
output
1
4,872
1
9,745
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive int...
instruction
0
4,873
1
9,746
No
output
1
4,873
1
9,747
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are N cities on a number line. The i-th city is located at coordinate x_i. Your objective is to visit all these cities at least once. In order to do so, you will first set a positive int...
instruction
0
4,874
1
9,748
No
output
1
4,874
1
9,749
Provide tags and a correct Python 3 solution for this coding contest problem. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plane into connected regions, possibly of infinite ...
instruction
0
5,407
1
10,814
Tags: geometry Correct Solution: ``` x, y = map(int, input().split()) u, v = map(int, input().split()) s = 0 for i in range(int(input())): a, b, c = map(int, input().split()) s += (a * x + b * y + c > 0) ^ (a * u + b * v + c > 0) print(s) ```
output
1
5,407
1
10,815
Provide tags and a correct Python 3 solution for this coding contest problem. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plane into connected regions, possibly of infinite ...
instruction
0
5,408
1
10,816
Tags: geometry Correct Solution: ``` x1,y1=[int(i) for i in input().split()] x2,y2=[int(i) for i in input().split()] n=int(input()) r=0 for i in range(n): a,b,c = [int(i) for i in input().split()] if (a*x1+b*y1+c)*(a*x2+b*y2+c)<0: r+=1 print(r) ```
output
1
5,408
1
10,817
Provide tags and a correct Python 3 solution for this coding contest problem. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plane into connected regions, possibly of infinite ...
instruction
0
5,409
1
10,818
Tags: geometry Correct Solution: ``` x,y = map(int,input().split()) x1,y1 = map(int,input().split()) n=int(input()) ans=0 for i in range(n): a,b,c=map(int,input().split()) if((a*x+b*y+c)*(a*x1+b*y1+c)<0): ans+=1 print(ans) ```
output
1
5,409
1
10,819
Provide tags and a correct Python 3 solution for this coding contest problem. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plane into connected regions, possibly of infinite ...
instruction
0
5,410
1
10,820
Tags: geometry Correct Solution: ``` x1,y1=map(int,input().split()) x2,y2=map(int,input().split()) a1=y1-y2 b1=x2-x1 c1=x2*(y2-y1)-y2*(x2-x1) def intersect(a2,b2,c2): global a1,b1,c1,x1,y1,x2,y2 if(a1*b2==a2*b1): return False x=(b1*c2-b2*c1)/(a1*b2-b1*a2) y=(a1*c2-c...
output
1
5,410
1
10,821
Provide tags and a correct Python 3 solution for this coding contest problem. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plane into connected regions, possibly of infinite ...
instruction
0
5,411
1
10,822
Tags: geometry Correct Solution: ``` #!/usr/bin/env python3 x1, y1 = (int(x) for x in input().split()) x2, y2 = (int(x) for x in input().split()) n = int(input()) ans = 0 for i in range(n): a, b, c = (int(x) for x in input().split()) point1 = a*x1 + b*y1 + c point2 = a*x2 + b*y2 + c if point1 * point2 ...
output
1
5,411
1
10,823
Provide tags and a correct Python 3 solution for this coding contest problem. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plane into connected regions, possibly of infinite ...
instruction
0
5,412
1
10,824
Tags: geometry Correct Solution: ``` def getMinSteps(x1, y1, x2, y2, n, lines): min_steps = 0 for i in range(n): a = lines[i][0] b = lines[i][1] c = lines[i][2] if (a*x1+b*y1+c)*(a*x2+b*y2+c) < 0: min_steps+=1 return min_steps x1, y1 = [int(x) for x in input().spl...
output
1
5,412
1
10,825
Provide tags and a correct Python 3 solution for this coding contest problem. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plane into connected regions, possibly of infinite ...
instruction
0
5,413
1
10,826
Tags: geometry Correct Solution: ``` hx, hy = map(int, input().split()) ux, uy = map(int, input().split()) n = int(input()) count = 0 for i in range(n): a,b,c = map(int, input().split()) h = a*hx + b*hy + c u = a*ux + b*uy + c if h*u<0: count += 1 print(count) ```
output
1
5,413
1
10,827
Provide tags and a correct Python 3 solution for this coding contest problem. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plane into connected regions, possibly of infinite ...
instruction
0
5,414
1
10,828
Tags: geometry Correct Solution: ``` h1, h2 = list(map(int,input().split())) u1, u2 = list(map(int,input().split())) pasos = 0 for i in int(input())*'_': a, b, c= list(map(int,input().split())) if (a * h1 + b * h2 + c) * (a * u1 + b * u2 + c) < 0: pasos+=1 print(pasos) ```
output
1
5,414
1
10,829
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plan...
instruction
0
5,415
1
10,830
Yes
output
1
5,415
1
10,831
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plan...
instruction
0
5,416
1
10,832
Yes
output
1
5,416
1
10,833
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plan...
instruction
0
5,417
1
10,834
Yes
output
1
5,417
1
10,835
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plan...
instruction
0
5,418
1
10,836
Yes
output
1
5,418
1
10,837
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plan...
instruction
0
5,419
1
10,838
No
output
1
5,419
1
10,839
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plan...
instruction
0
5,420
1
10,840
No
output
1
5,420
1
10,841
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plan...
instruction
0
5,421
1
10,842
No
output
1
5,421
1
10,843
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The roads divide the plan...
instruction
0
5,422
1
10,844
No
output
1
5,422
1
10,845
Provide tags and a correct Python 3 solution for this coding contest problem. In Berland there are n cities and n - 1 bidirectional roads. Each road connects some pair of cities, from any city you can get to any other one using only the given roads. In each city there is exactly one repair brigade. To repair some roa...
instruction
0
5,457
1
10,914
Tags: *special, dfs and similar, graphs, greedy, trees Correct Solution: ``` import sys import threading from collections import defaultdict def put(): return map(int, input().split()) def dfs(i, p, m): cnt = 1 z = 0 for j in tree[i]: if j==p: continue if cnt==m: cnt+=1 index =...
output
1
5,457
1
10,915
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In Berland there are n cities and n - 1 bidirectional roads. Each road connects some pair of cities, from any city you can get to any other one using only the given roads. In each city there is...
instruction
0
5,458
1
10,916
No
output
1
5,458
1
10,917
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In Berland there are n cities and n - 1 bidirectional roads. Each road connects some pair of cities, from any city you can get to any other one using only the given roads. In each city there is...
instruction
0
5,459
1
10,918
No
output
1
5,459
1
10,919
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In Berland there are n cities and n - 1 bidirectional roads. Each road connects some pair of cities, from any city you can get to any other one using only the given roads. In each city there is...
instruction
0
5,460
1
10,920
No
output
1
5,460
1
10,921
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In Berland there are n cities and n - 1 bidirectional roads. Each road connects some pair of cities, from any city you can get to any other one using only the given roads. In each city there is...
instruction
0
5,461
1
10,922
No
output
1
5,461
1
10,923
Provide a correct Python 3 solution for this coding contest problem. Emergency Evacuation The Japanese government plans to increase the number of inbound tourists to forty million in the year 2020, and sixty million in 2030. Not only increasing touristic appeal but also developing tourism infrastructure further is in...
instruction
0
5,751
1
11,502
"Correct Solution: ``` r, s, p = map(int, input().split()) ps = [None] * p for k in range(p): i, j = map(int, input().split()) if j <= s: j -= 1 ps[k] = r + 1 - i + abs(s - j) ans = 0 for t, p in enumerate(sorted(ps)[::-1]): ans = max(ans, t + p) print(ans) ```
output
1
5,751
1
11,503
Provide a correct Python 3 solution for this coding contest problem. Emergency Evacuation The Japanese government plans to increase the number of inbound tourists to forty million in the year 2020, and sixty million in 2030. Not only increasing touristic appeal but also developing tourism infrastructure further is in...
instruction
0
5,752
1
11,504
"Correct Solution: ``` #!/usr/bin/python3 import array from fractions import Fraction import functools import itertools import math import os import sys def main(): R, S, P = read_ints() A = [] for _ in range(P): i, j = read_ints() i -= 1 j -= 1 A.append((i, j)) print...
output
1
5,752
1
11,505
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You successfully found poor Arkady near the exit of the station you've perfectly predicted. You sent him home on a taxi and suddenly came up with a question. There are n crossroads in your city...
instruction
0
5,824
1
11,648
No
output
1
5,824
1
11,649
Provide tags and a correct Python 3 solution for this coding contest problem. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after station x is equal to (x+1) if x < n and 1 other...
instruction
0
5,829
1
11,658
Tags: implementation, math Correct Solution: ``` list1=list(map(int,input().split())) list2=[] flag=0 for i in range(list1[0]): list2.append(i+1) if(list1[1]==list1[3]): print('YES') for j in range(list1[0]): a=list1[1]+j if a>list1[0]: a=a-list1[0] if(list2[a-1]==list2[list1[3]-j-1]): ...
output
1
5,829
1
11,659
Provide tags and a correct Python 3 solution for this coding contest problem. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after station x is equal to (x+1) if x < n and 1 other...
instruction
0
5,830
1
11,660
Tags: implementation, math Correct Solution: ``` from sys import stdin # stdin=open('input.txt') def input(): return stdin.readline().strip() # from sys import stdout # stdout=open('input.txt',mode='w+') # def print1(x, end='\n'): # stdout.write(str(x) +end) # a, b = map(int, input().split()) # l = list(map(in...
output
1
5,830
1
11,661
Provide tags and a correct Python 3 solution for this coding contest problem. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after station x is equal to (x+1) if x < n and 1 other...
instruction
0
5,831
1
11,662
Tags: implementation, math Correct Solution: ``` n, a, x, b, y = (int(i)-1 for i in input().split()) n += 1 while True: if a == b: print('YES') break if a == x or b == y: print('NO') break a = (a+1) % n b = (b-1) % n ```
output
1
5,831
1
11,663
Provide tags and a correct Python 3 solution for this coding contest problem. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after station x is equal to (x+1) if x < n and 1 other...
instruction
0
5,832
1
11,664
Tags: implementation, math Correct Solution: ``` flag = True n,a,x,b,y = list(map(int,input().split())) for i in range(min((x-a)%n, (b-y)%n)): a = a+1 b = b-1 if a>n: a = 1 if b==0: b = n if a==b: print("YES") flag = False break if flag: print("NO") ```
output
1
5,832
1
11,665
Provide tags and a correct Python 3 solution for this coding contest problem. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after station x is equal to (x+1) if x < n and 1 other...
instruction
0
5,833
1
11,666
Tags: implementation, math Correct Solution: ``` if __name__ == '__main__': n, a, x, b, y = map(int, input().split()) a -= 1 b -= 1 x -= 1 y -= 1 while a != x and b != y: a = (a + 1) % n b = (b - 1) % n if a == b: print("YES") exit(0) print("N...
output
1
5,833
1
11,667
Provide tags and a correct Python 3 solution for this coding contest problem. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after station x is equal to (x+1) if x < n and 1 other...
instruction
0
5,834
1
11,668
Tags: implementation, math Correct Solution: ``` n, a, x, b, y = map(int,input().split()) while a != x and b != y: a += 1 b -= 1 if a > n:a = 1 if b <= 0:b = n if a == b: print("YES") exit() print("NO") ```
output
1
5,834
1
11,669
Provide tags and a correct Python 3 solution for this coding contest problem. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after station x is equal to (x+1) if x < n and 1 other...
instruction
0
5,835
1
11,670
Tags: implementation, math Correct Solution: ``` n, a, x, b, y = map(int, input().split()) m1 = [] m2 = [] while a != x: m1.append(a) a += 1 if a > n: a = 1 while b != y: m2.append(b) b -= 1 if b < 1: b = n m1.append(a) m2.append(b) b = False for i in range(min(len(m1), len(m2)))...
output
1
5,835
1
11,671
Provide tags and a correct Python 3 solution for this coding contest problem. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after station x is equal to (x+1) if x < n and 1 other...
instruction
0
5,836
1
11,672
Tags: implementation, math Correct Solution: ``` import sys n, a, x, b, y = [int(x) for x in input().split()] while a!=x and b!=y: a+= 1 if a==n+1: a = 1 b -= 1 if b==0: b = n if a==b: print('YES') sys.exit() print('NO') ```
output
1
5,836
1
11,673
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after s...
instruction
0
5,837
1
11,674
Yes
output
1
5,837
1
11,675
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after s...
instruction
0
5,838
1
11,676
Yes
output
1
5,838
1
11,677
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after s...
instruction
0
5,839
1
11,678
Yes
output
1
5,839
1
11,679
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after s...
instruction
0
5,840
1
11,680
Yes
output
1
5,840
1
11,681
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after s...
instruction
0
5,841
1
11,682
No
output
1
5,841
1
11,683
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after s...
instruction
0
5,842
1
11,684
No
output
1
5,842
1
11,685
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after s...
instruction
0
5,843
1
11,686
No
output
1
5,843
1
11,687
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The circle line of the Roflanpolis subway has n stations. There are two parallel routes in the subway. The first one visits stations in order 1 β†’ 2 β†’ … β†’ n β†’ 1 β†’ 2 β†’ … (so the next stop after s...
instruction
0
5,844
1
11,688
No
output
1
5,844
1
11,689
Provide tags and a correct Python 3 solution for this coding contest problem. In this problem we assume the Earth to be a completely round ball and its surface a perfect sphere. The length of the equator and any meridian is considered to be exactly 40 000 kilometers. Thus, travelling from North Pole to South Pole or v...
instruction
0
6,257
1
12,514
Tags: geometry, implementation Correct Solution: ``` n = int(input()) coord = 0 for i in range(n): ai, bi = input().split() ai = int(ai) if (coord == 0 and bi != 'South'): print("NO") break if (coord == 20000 and bi != 'North'): print("NO") break if (bi == 'North'): ...
output
1
6,257
1
12,515
Provide tags and a correct Python 3 solution for this coding contest problem. In this problem we assume the Earth to be a completely round ball and its surface a perfect sphere. The length of the equator and any meridian is considered to be exactly 40 000 kilometers. Thus, travelling from North Pole to South Pole or v...
instruction
0
6,258
1
12,516
Tags: geometry, implementation Correct Solution: ``` from math import sin def mp(): return map(int,input().split()) def lt(): return list(map(int,input().split())) def pt(x): print(x) def ip(): return input() def it(): return int(input()) def sl(x): return [t for t in x] def spl(x): return x.split() def aj(liste,...
output
1
6,258
1
12,517
Provide tags and a correct Python 3 solution for this coding contest problem. In this problem we assume the Earth to be a completely round ball and its surface a perfect sphere. The length of the equator and any meridian is considered to be exactly 40 000 kilometers. Thus, travelling from North Pole to South Pole or v...
instruction
0
6,259
1
12,518
Tags: geometry, implementation Correct Solution: ``` import math as mt import sys,string,bisect input=sys.stdin.readline from collections import deque,defaultdict L=lambda : list(map(int,input().split())) Ls=lambda : list(input().split()) M=lambda : map(int,input().split()) I=lambda :int(input()) def dist(x,y,c,d): ...
output
1
6,259
1
12,519
Provide tags and a correct Python 3 solution for this coding contest problem. In this problem we assume the Earth to be a completely round ball and its surface a perfect sphere. The length of the equator and any meridian is considered to be exactly 40 000 kilometers. Thus, travelling from North Pole to South Pole or v...
instruction
0
6,260
1
12,520
Tags: geometry, implementation Correct Solution: ``` n=int(input()) b=0 currentPos=0 for i in range(n): k,dir=input().split() k=int(k) if currentPos==0 and dir!='South': b=1 elif currentPos==20000 and dir!='North': b=1 elif dir=='North' and currentPos-k<0: b=1 elif dir=='...
output
1
6,260
1
12,521
Provide tags and a correct Python 3 solution for this coding contest problem. In this problem we assume the Earth to be a completely round ball and its surface a perfect sphere. The length of the equator and any meridian is considered to be exactly 40 000 kilometers. Thus, travelling from North Pole to South Pole or v...
instruction
0
6,261
1
12,522
Tags: geometry, implementation Correct Solution: ``` from sys import * from math import * n=int(stdin.readline()) m=[] for i in range(n): a = list(stdin.readline().split()) m.append(a) x=0 f=0 for i in range(n): if x==0 and m[i][1]!="South": f=1 break if x==20000 and m[i][1]!="North": ...
output
1
6,261
1
12,523