結果
問題 |
No.358 も~っと!門松列
|
ユーザー |
|
提出日時 | 2018-01-16 20:46:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 585 bytes |
コンパイル時間 | 1,645 ms |
コンパイル使用メモリ | 166,516 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 05:53:26 |
合計ジャッジ時間 | 2,623 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define FOR(i, m, n) for(int i = m; i < n; i++) bool kdmtChk(int a, int b, int c) { if (a == b || b == c || c == a) return false; if (max({a, b, c}) == b || min({a, b, c}) == b) { return true; } else { return false; } } int main() { int a, b, c; cin >> a >> b >> c; if (kdmtChk(a, b, c)) { cout << "INF" << endl; return 0; } int ans = 0; FOR(i, 2, max({a, b, c}) + 1) { ans += kdmtChk(a % i, b % i, c % i); } cout << ans << endl; return 0; }