Submission #22448

# Submission time Handle Problem Language Result Execution time Memory
22448 2017-04-30T04:48:19 Z 응 내인생 터졌어~(#957, sosfd) August14 Beginner Contest (KRIII5_ABC) Python 2
0 / 7
65 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 65 ms 13 KB Execution failed because the return code was nonzero