結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-13 00:39:45 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 906 bytes |
| コンパイル時間 | 654 ms |
| コンパイル使用メモリ | 82,036 KB |
| 実行使用メモリ | 52,752 KB |
| 最終ジャッジ日時 | 2024-10-02 23:53:32 |
| 合計ジャッジ時間 | 1,388 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 1 |
ソースコード
class Time:
def __init__(self, s: str) -> None:
f = s.find(":")
self.h = int(s[0:f])
self.m = int(s[f+1:])
def __add__(self, other):
time = Time("00:00")
time.h = self.h+other.h
time.m = self.m+other.m
time.h += int(time.m/60)
time.m %= 60
return time
def __sub__(self, other):
time = Time("00:00")
time.h = self.h-other.h
time.m = self.m-other.m
time.h %= 24
if time.m < 0:
time.h -= 1
time.m %= 60
return time
def show(self):
print(f"{self.h}:{self.m}")
def __str__(self):
return str(self.h*60+self.m)
def main():
cnt = Time("00:00")
n = int(input())
for i in range(n):
a, b = input().split()
cnt += (Time(b)-Time(a))
print(cnt)
# cnt.show()
if __name__ == "__main__":
main()