結果

問題 No.358 も~っと!門松列
ユーザー kikage
提出日時 2020-04-07 02:36:46
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 380 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 55,684 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-07 10:43:28
合計ジャッジ時間 1,077 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
    int A[3],cnt=0;
    cin >> A[0] >> A[1] >> A[2];
    for(int p=2;p<1000;p++){
        if((A[1]%p-A[0]%p)*(A[1]%p-A[2]%p)>0 && A[0]%p!=A[2]%p){
           cnt++;
        }
    }
    if((A[1]%1000-A[0]%1000)*(A[1]%1000-A[2]%1000)>0 && A[0]!=A[2]){
        cout << "INF" << endl;
    }else cout << cnt << endl;
    return 0;
}
0