結果
| 問題 |
No.312 置換処理
|
| コンテスト | |
| ユーザー |
piyoko_212
|
| 提出日時 | 2015-12-25 17:44:11 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 13 ms / 2,000 ms |
| コード長 | 368 bytes |
| コンパイル時間 | 581 ms |
| コンパイル使用メモリ | 43,980 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-15 11:59:45 |
| 合計ジャッジ時間 | 1,740 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 45 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:26: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | long long a;scanf("%lld",&a);
| ~~~~~^~~~~~~~~~~
ソースコード
#include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
vector<long long>f;
int main(){
long long a;scanf("%lld",&a);
for(int i=1;(long long)i*i<=a;i++){
if(a%i==0){
f.push_back(i);
f.push_back(a/i);
}
}
std::sort(f.begin(),f.end());
for(int i=0;i<f.size();i++){
if(f[i]==1||f[i]==2)continue;
printf("%lld\n",f[i]);return 0;
}
}
piyoko_212