結果
問題 | No.316 もっと刺激的なFizzBuzzをください |
ユーザー |
![]() |
提出日時 | 2016-04-14 23:27:05 |
言語 | PyPy2 (7.3.15) |
結果 |
AC
|
実行時間 | 170 ms / 1,000 ms |
コード長 | 281 bytes |
コンパイル時間 | 2,260 ms |
コンパイル使用メモリ | 76,700 KB |
実行使用メモリ | 77,184 KB |
最終ジャッジ日時 | 2024-11-21 12:19:56 |
合計ジャッジ時間 | 6,578 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
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=ay=bwhile x!=y:while x<y:x+=awhile y<x:y+=breturn xdef 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)