結果

問題 No.414 衝動
ユーザー iqueue02iqueue02
提出日時 2020-01-16 18:12:38
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 518 bytes
コンパイル時間 1,622 ms
コンパイル使用メモリ 165,004 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-06 04:45:03
合計ジャッジ時間 3,680 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 12 ms
4,376 KB
testcase_06 AC 12 ms
4,376 KB
testcase_07 WA -
testcase_08 AC 7 ms
4,376 KB
testcase_09 WA -
testcase_10 AC 2 ms
4,376 KB
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;

bool is_prime(ll n){
  for(ll i = 2; i*i <= n ; i++){
    if(n%i == 0) return false;
  }
  return n != 1LL;
}

int main(){
  ll n;
  cin >> n;
  if (is_prime(n)) {
    cout << 1 << " " << n << endl;
    return 0;
  }
  for (ll i = 2; i * i < n; i++) {
    if (n % i == 0) {
      cout << i << " " << n << endl;
      return 0; 
    }
  }
  return 0;
}
0