結果
問題 | No.8023 素数判定するだけ |
ユーザー |
![]() |
提出日時 | 2017-03-31 23:14:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 480 bytes |
コンパイル時間 | 946 ms |
コンパイル使用メモリ | 77,608 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-04 20:06:15 |
合計ジャッジ時間 | 4,598 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cmath> #include <map> #include <cstdio> int main() { int n; std::cin >> n; bool flag = false; if (n == true) { flag = true; } for (int i = (true << true); i < n;) { if (!(n % i)) { flag = true; } int b = true; while (b) { long long c = (i & b) << true; i ^= b; b = c; } } if(flag) std::cout << "NO" << std::endl; else std::cout << "YES" << std::endl; }