message stringlengths 2 45.8k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 254 108k | cluster float64 3 3 | __index_level_0__ int64 508 217k |
|---|---|---|---|---|---|
Provide a correct Python 3 solution for this coding contest problem.
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.
Currently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1.
He... | instruction | 0 | 93,378 | 3 | 186,756 |
"Correct Solution:
```
a,b,c,d = map(int,input().split())
x=c-a
y=d-b
print('R'*x+'U'*(y+1)+'L'*(x+1)+'D'*(y+1)+'R'+'U'*y+'R'*(x+1)+'D'*(y+1)+'L'*(x+1)+'U')
``` | output | 1 | 93,378 | 3 | 186,757 |
Provide a correct Python 3 solution for this coding contest problem.
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.
Currently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1.
He... | instruction | 0 | 93,379 | 3 | 186,758 |
"Correct Solution:
```
sx,sy,tx,ty=[int(x) for x in input().split()]
dx=tx-sx
dy=ty-sy
print("R"*dx+"U"*dy+"L"*dx+"D"*(dy+1)+"R"*(dx+1)+"U"*(dy+1)+"LU"+"L"*(dx+1)+"D"*(dy+1)+"R")
``` | output | 1 | 93,379 | 3 | 186,759 |
Provide a correct Python 3 solution for this coding contest problem.
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.
Currently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1.
He... | instruction | 0 | 93,380 | 3 | 186,760 |
"Correct Solution:
```
SX,SY,TX,TY=map(int,input().split())
x=TX-SX
y=TY-SY
print(''.join(['U'*y,'R'*x,'D'*y,'L'*x,'L','U'*(y+1),'R'*(x+1),'D','R','D'*(y+1),'L'*(x+1),'U']))
``` | output | 1 | 93,380 | 3 | 186,761 |
Provide a correct Python 3 solution for this coding contest problem.
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.
Currently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1.
He... | instruction | 0 | 93,381 | 3 | 186,762 |
"Correct Solution:
```
sx, sy, tx, ty = [int(x) for x in input().split()]
dx=tx-sx
dy=ty-sy
print('R'*dx+'U'*dy+'L'*dx+'D'*(dy+1)+'R'*(dx+1)+'U'*(dy+1)+'L'+'U'+'L'*(dx+1)+'D'*(dy+1)+'R')
``` | output | 1 | 93,381 | 3 | 186,763 |
Provide a correct Python 3 solution for this coding contest problem.
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.
Currently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1.
He... | instruction | 0 | 93,382 | 3 | 186,764 |
"Correct Solution:
```
a,b,c,d = list(map(int,input().split()))
a = c-a
b = d-b
print('R'*a+'U'*b+'L'*a+'D'*(b+1)+'R'*(a+1)+'U'*(b+1)
+'L'+'U'+'L'*(a+1)+'D'*(b+1)+'R')
``` | output | 1 | 93,382 | 3 | 186,765 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.
Currently, he is located at the point (sx,sy). In each second, he... | instruction | 0 | 93,383 | 3 | 186,766 |
Yes | output | 1 | 93,383 | 3 | 186,767 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.
Currently, he is located at the point (sx,sy). In each second, he... | instruction | 0 | 93,384 | 3 | 186,768 |
Yes | output | 1 | 93,384 | 3 | 186,769 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.
Currently, he is located at the point (sx,sy). In each second, he... | instruction | 0 | 93,385 | 3 | 186,770 |
Yes | output | 1 | 93,385 | 3 | 186,771 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.
Currently, he is located at the point (sx,sy). In each second, he... | instruction | 0 | 93,386 | 3 | 186,772 |
Yes | output | 1 | 93,386 | 3 | 186,773 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.
Currently, he is located at the point (sx,sy). In each second, he... | instruction | 0 | 93,387 | 3 | 186,774 |
No | output | 1 | 93,387 | 3 | 186,775 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.
Currently, he is located at the point (sx,sy). In each second, he... | instruction | 0 | 93,388 | 3 | 186,776 |
No | output | 1 | 93,388 | 3 | 186,777 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.
Currently, he is located at the point (sx,sy). In each second, he... | instruction | 0 | 93,389 | 3 | 186,778 |
No | output | 1 | 93,389 | 3 | 186,779 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.
Currently, he is located at the point (sx,sy). In each second, he... | instruction | 0 | 93,390 | 3 | 186,780 |
No | output | 1 | 93,390 | 3 | 186,781 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ... | instruction | 0 | 93,819 | 3 | 187,638 |
Tags: math, number theory
Correct Solution:
```
######### ## ## ## #### ##### ## # ## # ##
# # # # # # # # # # # # # # # # # # #
# # # # ### # # # # # # # # # # # #
# ##### # # # # ### # # # # # # # # #####
# # # # # #... | output | 1 | 93,819 | 3 | 187,639 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ... | instruction | 0 | 93,820 | 3 | 187,640 |
Tags: math, number theory
Correct Solution:
```
a,b=map(int,input().split())
c=0
while (a>0 and b>0):
c+=(a//b)
a,b=b,a%b
print(c)
``` | output | 1 | 93,820 | 3 | 187,641 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ... | instruction | 0 | 93,821 | 3 | 187,642 |
Tags: math, number theory
Correct Solution:
```
## don't understand why this works yet
c=0
a,b=map(int,input().split())
while a!=0 and b!=0:
c+=a//b
a=a%b
a,b=b,a
print(c)
``` | output | 1 | 93,821 | 3 | 187,643 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ... | instruction | 0 | 93,822 | 3 | 187,644 |
Tags: math, number theory
Correct Solution:
```
import math
import sys
import collections
import bisect
import string
import time
def get_ints():return map(int, sys.stdin.readline().strip().split())
def get_list():return list(map(int, sys.stdin.readline().strip().split()))
def get_string():return sys.stdin.readline().s... | output | 1 | 93,822 | 3 | 187,645 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ... | instruction | 0 | 93,823 | 3 | 187,646 |
Tags: math, number theory
Correct Solution:
```
a, b = map(int, input().split())
k = 1
while a != b:
if a > b:
x = a // b - (b == 1)
k += x
a -= b * x
else:
x = b // a - (a == 1)
k += x
b -= a * x
print(k)
``` | output | 1 | 93,823 | 3 | 187,647 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ... | instruction | 0 | 93,824 | 3 | 187,648 |
Tags: math, number theory
Correct Solution:
```
n,m=map(int,input().split())
a=0
while m:a+=n//m;n,m=m,n%m
print(a)
# Made By Mostafa_Khaled
``` | output | 1 | 93,824 | 3 | 187,649 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ... | instruction | 0 | 93,825 | 3 | 187,650 |
Tags: math, number theory
Correct Solution:
```
def check(x, y):
integer = x // y
if x == integer * y:
return integer
elif x > y:
result = integer
x = x % y
if x == 1:
result += y
return result
elif x != 1:
result += check(y, x)
... | output | 1 | 93,825 | 3 | 187,651 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ... | instruction | 0 | 93,826 | 3 | 187,652 |
Tags: math, number theory
Correct Solution:
```
a,b = map(int,input().split())
ans=0
c=1
while a!=1:
ans+=a//b
a,b = b , a%b
c+=1
if c>100:
break
ans+=b
print(ans)
``` | output | 1 | 93,826 | 3 | 187,653 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors wi... | instruction | 0 | 93,827 | 3 | 187,654 |
Yes | output | 1 | 93,827 | 3 | 187,655 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors wi... | instruction | 0 | 93,828 | 3 | 187,656 |
Yes | output | 1 | 93,828 | 3 | 187,657 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors wi... | instruction | 0 | 93,829 | 3 | 187,658 |
Yes | output | 1 | 93,829 | 3 | 187,659 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors wi... | instruction | 0 | 93,830 | 3 | 187,660 |
Yes | output | 1 | 93,830 | 3 | 187,661 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors wi... | instruction | 0 | 93,831 | 3 | 187,662 |
No | output | 1 | 93,831 | 3 | 187,663 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors wi... | instruction | 0 | 93,832 | 3 | 187,664 |
No | output | 1 | 93,832 | 3 | 187,665 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors wi... | instruction | 0 | 93,833 | 3 | 187,666 |
No | output | 1 | 93,833 | 3 | 187,667 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors wi... | instruction | 0 | 93,834 | 3 | 187,668 |
No | output | 1 | 93,834 | 3 | 187,669 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to get eventually. The computers are equipped with ... | instruction | 0 | 93,925 | 3 | 187,850 |
Tags: greedy, implementation
Correct Solution:
```
n = int(input())
a = [int(x) for x in input().split()]
hacked = 0
pos = 0
changes = 0
right = True
while hacked < n:
if right:
r = range(pos, n)
else:
r = range(pos, -1, -1)
for i in r:
if a[i] <= hacked:
a[i] = n + 1
... | output | 1 | 93,925 | 3 | 187,851 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to get eventually. The computers are equipped with ... | instruction | 0 | 93,926 | 3 | 187,852 |
Tags: greedy, implementation
Correct Solution:
```
n = int(input())
a = list(map(int, input().split()))
sum = 0
ans = 0
f = True
while sum != n:
for i in range(n):
if a[i] <= sum:
a[i] = 100000000000000000000000
sum += 1
if sum == n:
f = False
... | output | 1 | 93,926 | 3 | 187,853 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to get eventually. The computers are equipped with ... | instruction | 0 | 93,927 | 3 | 187,854 |
Tags: greedy, implementation
Correct Solution:
```
from sys import stdin
live = True
if not live: stdin = open("data.in", "r")
n = int(stdin.readline().strip())
c = list(map(int, stdin.readline().strip().split()))
g = dir = 0
ans = -1
while g != n:
ans += 1
if dir == 0:
for it in range(n):
if c[it] <= g and c[... | output | 1 | 93,927 | 3 | 187,855 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to get eventually. The computers are equipped with ... | instruction | 0 | 93,928 | 3 | 187,856 |
Tags: greedy, implementation
Correct Solution:
```
n = int(input())
a = list(map(int, input().split()))
visited = [False]*n
c = 0
cycles = 0
order = 1
while not all(visited):
for idx,i in enumerate(a[::order]):
if order == -1:
idx = n - idx - 1
if not visited[idx] and i <= c:
... | output | 1 | 93,928 | 3 | 187,857 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to get eventually. The computers are equipped with ... | instruction | 0 | 93,929 | 3 | 187,858 |
Tags: greedy, implementation
Correct Solution:
```
# 583B
# θ(n*log(n)) time
# θ(n) space
from queue import PriorityQueue
__author__ = 'artyom'
# SOLUTION
def main():
n = read()
a = read(3)
if n == 1:
return 0
ix = []
for i in range(n):
ix.append(i)
ix.sort(key=lambda x: a[x]... | output | 1 | 93,929 | 3 | 187,859 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to get eventually. The computers are equipped with ... | instruction | 0 | 93,930 | 3 | 187,860 |
Tags: greedy, implementation
Correct Solution:
```
n = int(input())
arr = list(map(int,input().split()))
info = 0
num =0
count = -1
while num != n:
count += 1
for i in range(n):
if arr[i]<=info:
arr[i] = 2000
info += 1
num += 1
arr.reverse()
print(count)
... | output | 1 | 93,930 | 3 | 187,861 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to get eventually. The computers are equipped with ... | instruction | 0 | 93,931 | 3 | 187,862 |
Tags: greedy, implementation
Correct Solution:
```
n = int(input())
a = list(map(int,input().split()))
direct = 1
pos = 0
now = 0
res = 0
checked = [0] * n
count = 0
while now < n:
if count < 10:
#print(checked)
count += 1
if direct == 1:
good = 0
for i in range(pos, n):
... | output | 1 | 93,931 | 3 | 187,863 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to get eventually. The computers are equipped with ... | instruction | 0 | 93,932 | 3 | 187,864 |
Tags: greedy, implementation
Correct Solution:
```
n = int(input())
a = list(map(int, input().split()))
cnt = 0
res = 0
while len(a):
b = []
for i in range(len(a)):
if a[i] <= cnt:
cnt += 1
else:
b.append(a[i])
a = b[::-1]
res += 1
print(res - 1)
``` | output | 1 | 93,932 | 3 | 187,865 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to g... | instruction | 0 | 93,933 | 3 | 187,866 |
Yes | output | 1 | 93,933 | 3 | 187,867 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to g... | instruction | 0 | 93,934 | 3 | 187,868 |
Yes | output | 1 | 93,934 | 3 | 187,869 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to g... | instruction | 0 | 93,935 | 3 | 187,870 |
Yes | output | 1 | 93,935 | 3 | 187,871 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to g... | instruction | 0 | 93,936 | 3 | 187,872 |
Yes | output | 1 | 93,936 | 3 | 187,873 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to g... | instruction | 0 | 93,937 | 3 | 187,874 |
No | output | 1 | 93,937 | 3 | 187,875 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to g... | instruction | 0 | 93,938 | 3 | 187,876 |
No | output | 1 | 93,938 | 3 | 187,877 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to g... | instruction | 0 | 93,939 | 3 | 187,878 |
No | output | 1 | 93,939 | 3 | 187,879 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Robot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to g... | instruction | 0 | 93,940 | 3 | 187,880 |
No | output | 1 | 93,940 | 3 | 187,881 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi).
They need to arrange a plan, but t... | instruction | 0 | 93,962 | 3 | 187,924 |
Tags: data structures, geometry, math
Correct Solution:
```
n = int(input())
d = {}
d2 = {}
d3 = {}
ans = 0
for i in range(n):
x,y = map(int,input().split())
if (x,y) not in d:
d[(x,y)] = 0
d[(x,y)] += 1
if x not in d2:
d2[x] = 0
d2[x] += 1
if y not in d3:
d3[y] = 0
d3[y] += 1
for i in d2:
ans += d2[i]*(d... | output | 1 | 93,962 | 3 | 187,925 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi).
They need to arrange a plan, but t... | instruction | 0 | 93,963 | 3 | 187,926 |
Tags: data structures, geometry, math
Correct Solution:
```
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def inc_val_of_dict(dictionary, key):
if key not in dictionary:
dictionary[key] = 0
dictionary[key] += 1
def main():
n = int(input())
p_ctr = dict()
x_ctr = dict()
y_ctr = dict(... | output | 1 | 93,963 | 3 | 187,927 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi).
They need to arrange a plan, but t... | instruction | 0 | 93,964 | 3 | 187,928 |
Tags: data structures, geometry, math
Correct Solution:
```
#maksonchiktoppotomuchtopishetcodnascretche
#maksonchiktoppotomuchtopishetcodnascretche
#maksonchiktoppotomuchtopishetcodnascretche
#maksonchiktoppotomuchtopishetcodnascretche
#maksonchiktoppotomuchtopishetcodnascretche
#maksonchiktoppotomuchtopishetcodnascret... | output | 1 | 93,964 | 3 | 187,929 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi).
They need to arrange a plan, but t... | instruction | 0 | 93,965 | 3 | 187,930 |
Tags: data structures, geometry, math
Correct Solution:
```
n=int(input())
a =0
b =0
s1 = {}
s2 = {}
s3 = {}
for i in range(n):
a,b = map(int, input().split())
s1[a]=s1.get(a,0)+1
s2[b]=s2.get(b,0)+1
tmp = (a,b)
s3[tmp] = s3.get(tmp,0)+1
sum=0
for i in s1.values():
sum+=(i-1)*(i)//2
for i in s... | output | 1 | 93,965 | 3 | 187,931 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi).
They need to arrange a plan, but t... | instruction | 0 | 93,966 | 3 | 187,932 |
Tags: data structures, geometry, math
Correct Solution:
```
n=int(input())
d1={}
d2={}
same={}
for i in range(n):
a,b=map(int,input().split())
if a in d1.keys():
d1[a]+=1
else:
d1[a]=1
if b in d2.keys():
d2[b]+=1
else:
d2[b]=1
#print(a,b)
if (a,b) in same.ke... | output | 1 | 93,966 | 3 | 187,933 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.