結果
| 問題 | No.312 置換処理 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-23 11:29:33 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 11 ms / 2,000 ms |
| コード長 | 265 bytes |
| 記録 | |
| コンパイル時間 | 489 ms |
| コンパイル使用メモリ | 74,660 KB |
| 実行使用メモリ | 7,852 KB |
| 最終ジャッジ日時 | 2026-01-23 11:29:35 |
| 合計ジャッジ時間 | 2,145 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 45 |
ソースコード
#include<iostream>
#include<cassert>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
long N;cin>>N;
for(long p=3;p*p<=N;p++)if(N%p==0)
{
cout<<p<<endl;
return 0;
}
if(N%2==0&&N/2>=3)cout<<N/2<<endl;
else cout<<N<<endl;
}