結果
| 問題 |
No.358 も~っと!門松列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-02 17:15:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 748 bytes |
| コンパイル時間 | 684 ms |
| コンパイル使用メモリ | 82,648 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-24 09:12:00 |
| 合計ジャッジ時間 | 1,685 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
#include <limits>
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;
template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;
bool IsKadomatsu(int a, int b, int c){
if(a == b || b == c || c == a) return false;
return max({a, b, c}) == b || min({a, b, c}) == b;
}
int main() {
int a, b, c;
cin >> a >> b >> c;
if(IsKadomatsu(a, b, c)) {
puts("INF");
}else {
int ans = 0;
for (int i = 1; i <= 1000; ++i) {
if(IsKadomatsu(a%i, b%i, c%i)) ans++;
}
cout << ans << "\n";
}
return 0;
}