結果
問題 |
No.358 も~っと!門松列
|
ユーザー |
|
提出日時 | 2016-12-23 01:29:22 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 639 bytes |
コンパイル時間 | 577 ms |
コンパイル使用メモリ | 81,036 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 14:59:29 |
合計ジャッジ時間 | 1,476 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
#define _USE_MATH_DEFINES #include<stdio.h> #include<string> #include<iostream> #include<cctype> #include<cstdio> #include<vector> #include<stack> #include<queue> #include <algorithm> #include<math.h> #include<set> #include<map> #include<iomanip> //#include<bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; int r = 0; if(a!=c&& ((b < a&&b < c) || (b > a&&b > c))) { cout << "INF" << endl; return 0; } int t = max(a, max(b, c)); for (int i = 3; i <= t; i++) if (a%i != c%i) { if (b%i < a%i&&b%i < c%i)r++; else if (b%i > a%i&&b%i > c%i)r++; } cout << r << endl; return 0; }