hiho week 183 register

Ended

Participants:162

Verdict:Runtime Error
Score:0 / 100
Submitted:2018-01-01 17:18:45

Lang:Python2

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import sys
from sets import Set
times = 0
X = 0
Y = 0
def cal_hash(XY):
    return X * 1001 + Y
    
def work():
    line = raw_input()
    times = int(line)
    S = Set()
    count = 0
    for i in range(times):
        line = raw_input()
        line = input()
        X = int(line.split()[0])
        Y = int(line.split()[1])
        count += 1
        dir = Set()
        dir.add(cal_hash(XY-1))
        dir.add(cal_hash(XY+1))
        dir.add(cal_hash(X-1Y))
        dir.add(cal_hash(X+1Y))
        count -= len(S & dir)
        S.add(cal_hash(XY))
        print count
if __name__ == "__main__":
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX