結果
問題 | No.312 置換処理 |
ユーザー |
![]() |
提出日時 | 2017-06-09 16:33:32 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 12 ms / 2,000 ms |
コード長 | 372 bytes |
コンパイル時間 | 525 ms |
コンパイル使用メモリ | 59,496 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-15 12:16:09 |
合計ジャッジ時間 | 1,671 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 |
ソースコード
#include <iostream> #include <cmath> using namespace std; typedef long long ll; int main(){ ll N; cin >> N; for(size_t i=3; i<=sqrt(N); i++){ if(N % i == 0){ cout << i << endl; return 0; } } if(N % 2 == 0){ if(N == 4){ cout << N << endl; }else{ cout << N/2 << endl; } }else{ cout << N << endl; } return 0; }