Submission #22452

# Submission time Handle Problem Language Result Execution time Memory
22452 2017-04-30T04:49:49 Z sosfd Sequence (BOI14_sequence) Python 2
0 / 100
60 ms 13 KB
#-*- coding: utf-8 -*-
import httplib
from HTMLParser import HTMLParser

arr = [0] * 1000010
inTD = False
inPRO = False
printPro = False
flag = 0

class MyHTMLParser(HTMLParser):
    flag  = 0
    def handle_starttag(self, tag, attrs):
        global inTD,inPRO,printPro,flag
        if tag == 'h3':
            inTD = True
        if tag == 'span':
           for name, value in attrs:
               if value == "problem_number":
                   #print 'test'
                   printPro = True
        return
            
            
    def handle_endtag(self, tag):
        global inTD,inPRO,printPro,flag
        if tag =="h3":
            inTD = False
        #if tag == 'span':
        printPro = False
        return
            
    def handle_data(self, data):
        global inTD,inPRO,printPro,flag,arr
        if inTD == True:
            if data.startswith("푼"):
                flag = 1
            if data.startswith("시도"):
                flag = 2

        if printPro == True:
            if flag == 1:
                arr[int(data)] =1
            if flag == 2:
                arr[int(data)] = 2


        return


conn = httplib.HTTPSConnection("www.acmicpc.net")
conn.request("GET", "/user/august14")
r1 = conn.getresponse()

s = r1.read()

parser = MyHTMLParser()
parser.feed(s);

n = input()

for i in range(0,n):
    t = input()
    x = int(t)
    if(x <0):
        print 'VH'
        continue
    if arr[x] == 1:
        print 'E'
        continue
    if arr[x] == 0:
        print 'VH'
        continue
    if arr[x] == 2:
        print 'H'
        continue


# Verdict Execution time Memory Grader output
1 Runtime error 60 ms 13 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 58 ms 13 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 60 ms 13 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 60 ms 13 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -