結果

問題 No.358 も~っと!門松列
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-07-30 17:25:44
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 509 bytes
コンパイル時間 2,013 ms
コンパイル使用メモリ 197,992 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-18 10:00:00
合計ジャッジ時間 2,999 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,380 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
4,380 KB
testcase_07 WA -
testcase_08 AC 1 ms
4,376 KB
testcase_09 WA -
testcase_10 AC 1 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
4,380 KB
testcase_14 WA -
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 WA -
testcase_21 AC 2 ms
4,376 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if (a==b||a==c||b==c) cout << 0;
    else if (b > a && b > c || b < a && b < c) cout << "INF";
    else {
        int cnt = 0;
        for (int i = 1; i <= 1000; i++) {
            int ta = a%i;
            int tb = b%i;
            int tc = c%i;
            if (tb > ta && tb > tc || tb < ta && tb < tc) cnt++;
        }
        cout << cnt;
    }
    cout << endl;
    return 0;
}
0