結果
| 問題 |
No.8023 素数判定するだけ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-07 15:04:46 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 179 bytes |
| コンパイル時間 | 573 ms |
| コンパイル使用メモリ | 63,908 KB |
| 最終ジャッジ日時 | 2025-02-24 16:25:49 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 25 |
コンパイルメッセージ
main.cpp:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import<ios>
| ^~~~~~
main.cpp:2:91: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
2 | int z;int g(int a,int b){while(b){int t=a;a^=b;b=(t&b)<<!z;}return a;}int n,o=!z,i=g(o,o);main(){scanf("%ld",&n);for(;i*i<=n;i=g(i,o))n=n%i?n:z;puts(n>o?"YES":"NO");}
| ^~~~
main.cpp: In function ‘int main()’:
main.cpp:2:107: warning: format ‘%ld’ expects argument of type ‘long int*’, but argument 2 has type ‘int*’ [-Wformat=]
2 | int z;int g(int a,int b){while(b){int t=a;a^=b;b=(t&b)<<!z;}return a;}int n,o=!z,i=g(o,o);main(){scanf("%ld",&n);for(;i*i<=n;i=g(i,o))n=n%i?n:z;puts(n>o?"YES":"NO");}
| ~~^ ~~
| | |
| | int*
| long int*
| %d
main.cpp:2:103: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
2 | int z;int g(int a,int b){while(b){int t=a;a^=b;b=(t&b)<<!z;}return a;}int n,o=!z,i=g(o,o);main(){scanf("%ld",&n);for(;i*i<=n;i=g(i,o))n=n%i?n:z;puts(n>o?"YES":"NO");}
| ~~~~~^~~~~~~~~~
ソースコード
#import<ios>
int z;int g(int a,int b){while(b){int t=a;a^=b;b=(t&b)<<!z;}return a;}int n,o=!z,i=g(o,o);main(){scanf("%ld",&n);for(;i*i<=n;i=g(i,o))n=n%i?n:z;puts(n>o?"YES":"NO");}