# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1171897 | Isam | Kaučuk (COCI21_kaucuk) | Pypy 3 | 133 ms | 48808 KiB |
def main():
N = int(input())
sec = 0
subsec = 0
subsubsec = 0
for _ in range(N):
type, name = input().split()
if type == "section":
subsec = subsubsec = 0
sec += 1
print(f"{sec} {name}")
elif type == "subsection":
subsubsec = 0
subsec += 1
print(f"{sec}.{subsec} {name}")
else:
subsubsec += 1
print(f"{sec}.{subsec}.{subsubsec} {name}")
if __name__ == "__main__":
main()
컴파일 시 표준 출력 (stdout) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |