結果
| 問題 | 
                            No.358 も~っと!門松列
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2016-11-19 16:59:04 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 473 bytes | 
| コンパイル時間 | 1,541 ms | 
| コンパイル使用メモリ | 166,292 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-26 22:03:14 | 
| 合計ジャッジ時間 | 2,299 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 23 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
bool ok( int a, int b, int c ){
  if( a == b or b == c or a == c )
    return false;
  if( max( { a, b, c } ) == b or min( { a, b, c } ) == b )
    return true;
  return false;
}
signed main(){
  int a, b, c; cin >> a >> b >> c;
  if( ok( a, b, c ) )
    cout << "INF" << endl;
  else{
    int ans = 0;
    for( int i = 1; i <= 1000; ++i )
      ans += ok( a % i, b % i, c % i );
    cout << ans << endl;
  }
  return 0;
}