結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー tabataba
提出日時 2016-04-14 23:15:13
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 234 bytes
コンパイル時間 50 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 01:34:41
合計ジャッジ時間 1,802 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
6,816 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 13 ms
6,940 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 15 ms
6,948 KB
testcase_13 AC 13 ms
6,944 KB
testcase_14 AC 14 ms
6,940 KB
testcase_15 AC 15 ms
6,940 KB
testcase_16 AC 15 ms
6,940 KB
testcase_17 AC 14 ms
6,940 KB
testcase_18 AC 14 ms
6,944 KB
testcase_19 AC 13 ms
6,940 KB
testcase_20 AC 14 ms
6,940 KB
testcase_21 AC 14 ms
6,940 KB
testcase_22 AC 13 ms
6,940 KB
testcase_23 AC 14 ms
6,944 KB
testcase_24 AC 14 ms
6,944 KB
testcase_25 AC 12 ms
6,944 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 13 ms
6,940 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 13 ms
6,940 KB
testcase_35 AC 14 ms
6,944 KB
testcase_36 AC 14 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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:
		if x<y:
			x+=a
		else:
			y+=b
	return x
print n/a+n/b+n/c-n/s(a,b)-n/s(a,c)-n/s(b,c)
0