AtCoder Beginner Contest 001

Submission #3736140

Source codeソースコード

def S_round(S):
  if(S != '0000'):
    S_tail = int(S[-1])
    if(S_tail < 5):
      return S[:3] + '0'
    elif(S_tail >= 5):
      return S[:3] + '5'
  else:
    return S
    
def E_round(E):
  if(E != '2400'):
    E_tail = int(E[-1])
    if(0 < E_tail < 5):
      return E[:3] + '5'
    elif(E_tail >= 5):
      if(int(E[2]) + 1 == 6):
        return E[0] + str(int(E[1]) + 1) + '0' + '0'
      else:
        return E[:2] + str(int(E[2]) + 1) + '0'
    else:
      return E[:3] + '0'
  else:
    return E

def S_E_join(S, E):
  return S + '-' + E

s_index = 0
e_index = 1
tmp_start = 0
tmp_end = 0
SE_list = []
results = []
N = int(input())
for i in range(1,N+1):
  S_i, E_i = input().split('-')
  SE_list.append((S_round(S_i), E_round(E_i)))
SE_list.sort()
for SE in SE_list:
  if(tmp_start == 0):
    tmp_start = SE[s_index]
    tmp_end = SE[e_index]
  elif(SE[s_index] <= tmp_end):
    if(tmp_end <= SE[e_index]):
      tmp_end = SE[e_index]
  else:
    results.append(S_E_join(tmp_start,tmp_end))
    tmp_start = SE[s_index]
    tmp_end = SE[e_index]
results.append(S_E_join(tmp_start,tmp_end))

for result in results:
  print(result)

Submission

Task問題 D - 感雨時刻の整理
User nameユーザ名 pto8913
Created time投稿日時
Language言語 Python3 (3.4.3)
Status状態 WA
Score得点 0
Source lengthソースコード長 1194 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
all 0 / 100 00_sample_01.txt,00_sample_02.txt,00_sample_03.txt,cho_cho_chokudai.txt,chokudai_ga_cho.txt,test_01.txt,test_02.txt,test_03.txt,test_04.txt,test_05.txt,test_06.txt,test_07.txt,test_08.txt,test_09.txt,test_10.txt,test_11.txt,test_12.txt,test_13.txt,test_14.txt,test_15.txt,test_16.txt,test_17.txt,test_18.txt,test_19.txt,test_20.txt,test_21.txt,test_22.txt,test_23.txt,test_24.txt,test_25.txt,test_26.txt,test_27.txt,test_28.txt,test_29.txt,test_30.txt,test_31.txt,test_32.txt,test_33.txt,test_34.txt,test_35.txt,test_36.txt,test_37.txt,test_38.txt,test_39.txt,test_40.txt,test_41.txt,test_42.txt,test_43.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
00_sample_01.txt AC 18 ms 3064 KB
00_sample_02.txt AC 18 ms 3064 KB
00_sample_03.txt AC 18 ms 3064 KB
cho_cho_chokudai.txt AC 171 ms 8564 KB
chokudai_ga_cho.txt AC 167 ms 8556 KB
test_01.txt WA
test_02.txt WA
test_03.txt WA
test_04.txt WA
test_05.txt WA
test_06.txt AC 18 ms 3064 KB
test_07.txt AC 18 ms 3064 KB
test_08.txt AC 18 ms 3064 KB
test_09.txt AC 20 ms 3064 KB
test_10.txt AC 21 ms 3064 KB
test_11.txt AC 20 ms 3064 KB
test_12.txt AC 19 ms 3064 KB
test_13.txt AC 19 ms 3064 KB
test_14.txt AC 20 ms 3064 KB
test_15.txt AC 21 ms 3188 KB
test_16.txt AC 19 ms 3064 KB
test_17.txt AC 20 ms 3064 KB
test_18.txt AC 19 ms 3064 KB
test_19.txt AC 20 ms 3064 KB
test_20.txt AC 20 ms 3064 KB
test_21.txt AC 180 ms 8564 KB
test_22.txt AC 183 ms 8564 KB
test_23.txt AC 184 ms 8564 KB
test_24.txt AC 183 ms 8576 KB
test_25.txt AC 180 ms 8556 KB
test_26.txt WA
test_27.txt AC 151 ms 8556 KB
test_28.txt WA
test_29.txt AC 18 ms 3064 KB
test_30.txt WA
test_31.txt WA
test_32.txt WA
test_33.txt WA
test_34.txt AC 18 ms 3064 KB
test_35.txt WA
test_36.txt AC 181 ms 8564 KB
test_37.txt WA
test_38.txt AC 180 ms 8556 KB
test_39.txt AC 177 ms 8564 KB
test_40.txt WA
test_41.txt AC 151 ms 8556 KB
test_42.txt AC 174 ms 8576 KB
test_43.txt AC 149 ms 8552 KB