結果
問題 | No.8023 素数判定するだけ |
ユーザー |
|
提出日時 | 2024-10-07 15:06:21 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 176 bytes |
コンパイル時間 | 609 ms |
コンパイル使用メモリ | 63,128 KB |
最終ジャッジ日時 | 2025-02-24 16:25:55 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 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<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<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<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<n;i=g(i,o))n=n%i?n:z;puts(n>o?"YES":"NO");}