結果
| 問題 |
No.358 も~っと!門松列
|
| コンテスト | |
| ユーザー |
mako55go
|
| 提出日時 | 2016-04-17 23:21:25 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 585 bytes |
| コンパイル時間 | 475 ms |
| コンパイル使用メモリ | 62,244 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-04 10:54:37 |
| 合計ジャッジ時間 | 1,351 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 WA * 4 |
ソースコード
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include<string>
#include <math.h>
using namespace std;
int main() {
int a, b, c;
int i=1;
int d, e, f;
int count = 0;
cin >> a >> b >> c;
if (a > c) {
swap(a, c);
}
if (a == b || b == c || c == a) {
cout << "0" << endl;
}
else if (b < c&&b < a) {
cout << "INF" << endl;
}
else {
while (i < c+1) {
d = a % i;
e = b % i;
f = c % i;
if (d == f) {}
else if (d < e&&f < e) {
count++;
}
else if (d > e&&f>e) {
count++;
}
i++;
}
cout << count<<endl;
}
return 0;
}
mako55go