結果
問題 |
No.358 も~っと!門松列
|
ユーザー |
![]() |
提出日時 | 2016-04-17 23:11:01 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 829 bytes |
コンパイル時間 | 596 ms |
コンパイル使用メモリ | 80,920 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-04 10:52:22 |
合計ジャッジ時間 | 1,337 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 WA * 2 |
ソースコード
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <set> #include <queue> #include <string> #include <iomanip> using namespace std; #define ll long long int #define tiii tuple<int,int,int> #define pii pair<int,int> int main() { int a,b,c; cin >> a >>b>>c; if(b > a && b > c) { cout << "INF" << endl; return 0; } if(b < a && b < c) { cout << "INF" << endl; return 0; } int sum = 0; for(int i = 1;i < 1002;i++) { int ma = a % i; int mb = b % i; int mc = c % i; if(mb > ma && mb > mc && ma != mc) { sum++; } else if(mb < ma && mb < mc && ma != mc) { sum++; } } cout << sum << endl; return 0; }