Submission #22485

# Submission time Handle Problem Language Result Execution time Memory
22485 2017-04-30T05:03:07 Z 응 내인생 터졌어~(#957, sosfd) August14 Beginner Contest (KRIII5_ABC) Python 2
0 / 7
664 ms 18 KB
#-*- coding: utf-8 -*-
import httplib
import sys
from HTMLParser import HTMLParser

n = input()

arr = [0]*100010

for i in range(0,n):
    t = input()
    x = int(t)
    arr[i] = x

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);

for i in range(0,n):
    x = arr[i]
    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 664 ms 18 KB Execution failed because the return code was nonzero