結果

問題 No.358 も~っと!門松列
ユーザー k
提出日時 2020-06-26 00:42:23
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 17 ms / 1,000 ms
コード長 547 bytes
コンパイル時間 1,901 ms
コンパイル使用メモリ 193,580 KB
最終ジャッジ日時 2025-01-11 10:30:08
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for(int i=0; i<(int)(n); i++)

bool check(int x, int y, int z) {
  if (x == y || y == z || z == x) return false;
  return y == max({x, y, z}) || y == min({x, y, z});
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int x, y, z;
  cin >> x >> y >> z;

  if (check(x, y, z))
    cout << "INF" << endl;
  else {
    int ret = 0;
    for (int i = 1; i < 2000; i++) {
      if (check(x % i, y % i, z % i))
        ++ret;
    }
    cout << ret << endl;
  }

  return 0;
}
0