結果
| 問題 |
No.8023 素数判定するだけ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-05 05:57:13 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 263 bytes |
| コンパイル時間 | 244 ms |
| コンパイル使用メモリ | 27,136 KB |
| 最終ジャッジ日時 | 2025-01-10 06:41:38 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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);
| ~~~~~^~~~~~~~~
ソースコード
#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;){
if(!(n%i)) ok=false;
// add one
int m=true;
while(i&m){ i=i^m; m<<=true; }
i=i^m;
}
puts(ok?"YES":"NO");
}