結果

問題 No.1198 お菓子配り-1
ユーザー tonyu0
提出日時 2020-08-28 23:12:18
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 697 bytes
コンパイル時間 1,228 ms
コンパイル使用メモリ 101,356 KB
最終ジャッジ日時 2025-01-13 19:23:11
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 7 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <tuple>
#include <vector>
using namespace std;
using ll = int64_t;
#define rep(i, j, n) for (int i = j; i < (int)n; ++i)
#define rrep(i, j, n) for (int i = (int)n - 1; j <= i; --i)

int main() {
  string s;
  cin >> s;
  if (s.size() > 12)
    cout << -1 << endl;
  else {
    ll n = atoll(s.c_str());
    ll i = 1;
    while (i * i <= n) {
      if (n % i == 0) {
        ll c = i;
        ll d = n / i;
        if ((c + d) % 2 == 0) {
          cout << 1 << endl;
          return 0;
        }
      }
      i++;
    }
  }
  cout << -1 << endl;
  return 0;
}
0