結果
問題 | No.1486 ロボット |
ユーザー |
![]() |
提出日時 | 2021-04-23 21:33:02 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 597 ms / 2,000 ms |
コード長 | 380 bytes |
コンパイル時間 | 92 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 18,372 KB |
最終ジャッジ日時 | 2024-07-04 07:41:32 |
合計ジャッジ時間 | 3,311 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
def lcm(x,y):def gcd(x, y):if y == 0:return xelse:return gcd(y,x%y)return (x*y)//gcd(x,y)s = list(map(int,input().split()))lc = lcm(s[0]+s[1],s[2]+s[3])sec = [0]*lcfor i in range(0,lc):x = i%(s[0]+s[1])y = i%(s[2]+s[3])if x<s[0] and y<s[2]:sec[i] = 1print(sum(sec)*(s[4]//lc)+sum(sec[:s[4]%lc]))