結果
| 問題 | 
                            No.358 も~っと!門松列
                             | 
                    
| コンテスト | |
| ユーザー | 
                             horiesiniti
                         | 
                    
| 提出日時 | 2016-05-25 11:33:33 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 1 ms / 1,000 ms | 
| コード長 | 361 bytes | 
| コンパイル時間 | 203 ms | 
| コンパイル使用メモリ | 22,912 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-10-07 14:03:21 | 
| 合計ジャッジ時間 | 1,051 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 23 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%d %d %d",&a,&b,&c);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
using namespace std;
bool ok(int a,int b, int c){
	return ((a>b)&&(b<c)&&(a!=c))||((a<b)&&(b>c)&&(a!=c));
}
int main() {
	// your code goes here
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
	if(ok(a,b,c)){
		printf("INF\n");
	}else{
		int ans=0;
		for(int i=1;(i<=a)||(i<=b)||(i<=c);i++){
			ans+=ok(a%i,b%i,c%i);
		}
		printf("%d\n",ans);
	}
}
            
            
            
        
            
horiesiniti