結果

問題 No.3152 neither multiple of A nor B
ユーザー ゆーてぃー
提出日時 2025-05-20 22:04:33
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 177 bytes
コンパイル時間 1,464 ms
コンパイル使用メモリ 24,192 KB
実行使用メモリ 16,192 KB
最終ジャッジ日時 2025-05-20 22:04:38
合計ジャッジ時間 4,027 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other WA * 19 TLE * 1 -- * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:4:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 |         scanf("%d %d %d",&N,&A,&B);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
int main(){
	int N,A,B,count=0;
	scanf("%d %d %d",&N,&A,&B);
	for(int i=1;i<=N;i++){
		if(i%A!=0&&i%B!=0){
			count++;
		}
	}
	printf("%d",count);
	return 0;
}
0