結果
| 問題 |
No.358 も~っと!門松列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-04-17 22:31:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 1,000 ms |
| コード長 | 472 bytes |
| コンパイル時間 | 1,090 ms |
| コンパイル使用メモリ | 158,572 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-04 10:31:47 |
| 合計ジャッジ時間 | 2,217 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
bool isKadomatsu(long long x, long long y, long long z) {
if (x == y || y == z || x == z) return false;
if (x > y && y < z) return true;
if (x < y && y > z) return true;
return false;
}
int main() {
int a, b, c;
cin >> a >> b >> c;
int ans = 0;
for (int i = 1; i <= 1000000; i++) {
if (isKadomatsu(a % i, b % i, c % i)) ans++;
}
if (ans >= 10000) {
cout << "INF" << endl;
} else {
cout << ans << endl;
}
}