結果

問題 No.312 置換処理
ユーザー iqueue02
提出日時 2020-07-09 22:30:16
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 495 bytes
コンパイル時間 1,888 ms
コンパイル使用メモリ 192,220 KB
最終ジャッジ日時 2025-01-11 17:16:13
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 32 WA * 13
権限があれば一括ダウンロードができます

ソースコード

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 long double ld;
typedef pair<int,int> P;

int main() {
  ll n;
  cin >> n;
  ll res = n;
  for (ll x = 1; x * x <= n; x++) {
    if (n % x == 0) {
      if (x > 2 && x % 2 != 0) res = min(res, x);
      if (x != n / x) {
        if ((n / x > 2 ) && (n / x) % 2 != 0) res = min(res, n / x);
      } 
    }
  }
  cout << res << endl;
  return 0;
} 
0