結果
問題 | No.358 も~っと!門松列 |
ユーザー |
![]() |
提出日時 | 2016-04-17 22:35:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 461 bytes |
コンパイル時間 | 477 ms |
コンパイル使用メモリ | 56,152 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-04 10:34:20 |
合計ジャッジ時間 | 1,205 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
#include <iostream>using namespace std;int main(){int a, b, c;cin>>a>>b>>c;if (a!=c and (b>a and b>c or b<a and b<c))cout<<"INF\n";else if (a==c or b==c or a==b)cout<<0<<endl;else {int res=0;for(int i=3; i<10000; ++i) {int x=a%i;int y=b%i;int z=c%i;if (x!=z and (y>x and y>z or y<x and y<z)) ++res;}cout<<res<<endl;}}