結果
問題 |
No.316 もっと刺激的なFizzBuzzをください
|
ユーザー |
![]() |
提出日時 | 2016-04-14 23:26:27 |
言語 | Python2 (2.7.18) |
結果 |
TLE
|
実行時間 | - |
コード長 | 281 bytes |
コンパイル時間 | 226 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 16,896 KB |
最終ジャッジ日時 | 2024-10-04 09:02:48 |
合計ジャッジ時間 | 4,563 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | TLE * 1 -- * 32 |
ソースコード
n=input() a,b,c=map(int,raw_input().split()) #print sum(1 for i in xrange(1,n+1)if i%a==0 or i%b==0 or i%c==0) def s(a,b): x=a y=b while x!=y: while x<y:x+=a while y<x:y+=b return x def ss(a,b,c): return s(s(a,b),c) print n/a+n/b+n/c-n/s(a,b)-n/s(a,c)-n/s(b,c)+n/ss(a,b,c)