結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー tabataba
提出日時 2016-04-14 23:27:05
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 159 ms / 1,000 ms
コード長 281 bytes
コンパイル時間 2,070 ms
コンパイル使用メモリ 76,928 KB
実行使用メモリ 77,312 KB
最終ジャッジ日時 2024-05-01 09:05:28
合計ジャッジ時間 4,347 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 159 ms
76,800 KB
testcase_01 AC 73 ms
76,336 KB
testcase_02 AC 72 ms
75,392 KB
testcase_03 AC 68 ms
75,392 KB
testcase_04 AC 68 ms
75,580 KB
testcase_05 AC 65 ms
75,392 KB
testcase_06 AC 64 ms
75,264 KB
testcase_07 AC 64 ms
75,528 KB
testcase_08 AC 64 ms
75,648 KB
testcase_09 AC 65 ms
75,392 KB
testcase_10 AC 68 ms
75,648 KB
testcase_11 AC 68 ms
75,536 KB
testcase_12 AC 71 ms
76,160 KB
testcase_13 AC 71 ms
76,696 KB
testcase_14 AC 76 ms
77,312 KB
testcase_15 AC 98 ms
77,052 KB
testcase_16 AC 73 ms
76,700 KB
testcase_17 AC 73 ms
76,928 KB
testcase_18 AC 72 ms
76,064 KB
testcase_19 AC 70 ms
76,080 KB
testcase_20 AC 75 ms
77,056 KB
testcase_21 AC 76 ms
76,820 KB
testcase_22 AC 73 ms
76,580 KB
testcase_23 AC 93 ms
76,708 KB
testcase_24 AC 109 ms
76,816 KB
testcase_25 AC 72 ms
76,672 KB
testcase_26 AC 65 ms
75,420 KB
testcase_27 AC 68 ms
75,544 KB
testcase_28 AC 66 ms
75,304 KB
testcase_29 AC 80 ms
76,928 KB
testcase_30 AC 70 ms
75,936 KB
testcase_31 AC 68 ms
76,456 KB
testcase_32 AC 76 ms
76,800 KB
testcase_33 AC 68 ms
76,544 KB
testcase_34 AC 72 ms
76,800 KB
testcase_35 AC 70 ms
76,604 KB
testcase_36 AC 71 ms
76,792 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:
		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)
0