結果

問題 No.36 素数が嫌い!
ユーザー akakimidori
提出日時 2015-07-26 08:43:45
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 339 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 20,736 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-08 14:01:43
合計ジャッジ時間 986 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 13 WA * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         scanf("%lld",&N);
      |         ^~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<stdlib.h>

typedef long long int ln;

int main(void){

	ln N;
	scanf("%lld",&N);

	if(N==1){
		printf("NO\n");
		return 0;
	}

	int k;
	k=2;
	int count;
	count=2;
	while(k*k<=N && count < 2){
		if(N%k==0){
			count++;
		}
		k++;
	}

	if(count==2){
		printf("YES\n");
	} else {
		printf("NO\n");
	}

	return 0;
}
0