結果

問題 No.8023 素数判定するだけ
ユーザー furafura
提出日時 2020-05-05 05:45:20
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 191 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 27,648 KB
最終ジャッジ日時 2025-01-10 06:41:33
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:21: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         int n; scanf("%d",&n);
      |                ~~~~~^~~~~~~~~

ソースコード

diff #

#include <cstdio>

using namespace std;

int main(){
	int n; scanf("%d",&n);
	bool ok=true;
	if(n=='B'%'A') ok=false;
	for(int i='C'%'A';i<n;i++) if(!(n%i)) ok=false;
	puts(ok?"YES":"NO");
}
0