結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
![]() |
提出日時 | 2014-10-10 16:55:50 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 443 bytes |
コンパイル時間 | 803 ms |
コンパイル使用メモリ | 65,644 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-12-30 08:29:02 |
合計ジャッジ時間 | 13,867 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 16 WA * 8 TLE * 2 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:22:20: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long long int*’ [-Wformat=] 22 | scanf("%I64d",&n);//%d%d%d%d",&n,&v,&x,&y,&ax,&ay); | ~~~~^ ~~ | | | | | long long int* | int* | %I64lld main.cpp:22:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 22 | scanf("%I64d",&n);//%d%d%d%d",&n,&v,&x,&y,&ax,&ay); | ~~~~~^~~~~~~~~~~~
ソースコード
#include <cstdlib> #include <cstdio> #include <cstring> #include <algorithm> #include <iostream> #include <map> #include <vector> #include <queue> using namespace std; /* 184 //名前が 184 解けなかった */ int main(){ long long n; scanf("%I64d",&n);//%d%d%d%d",&n,&v,&x,&y,&ax,&ay); int cnt=0; for(int i=2;i*i<=n;i++)if(n%i==0)cnt++,n/=i; printf(cnt<=2?"NO\n":"YES""\n"); return 0; }