結果

問題 No.358 も~っと!門松列
ユーザー rapurasu
提出日時 2016-08-10 14:57:41
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 509 bytes
コンパイル時間 1,226 ms
コンパイル使用メモリ 158,468 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-07 08:38:14
合計ジャッジ時間 2,121 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

 #include<bits/stdc++.h>
 using namespace std;
#define INF 1000000000
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
int main(){
    int A,B,C;
    cin>>A>>B>>C;
    if((A<B&&C<B)||(A>B&&C>B)){
       cout<<"INF"<<endl;
       return 0;
    }
    int count=0;
    REP(i,1000){
        if(i==0)continue;
        int A2=A%i;
        int B2=B%i;
        int C2=C%i;
        if(A2<B2&&C2<B2){
           count++;
        }
        if(A2>B2&&C2>B2){
           count++;
        }
    }
    cout<<count<<endl;
}
0