結果

問題 No.358 も~っと!門松列
ユーザー notetonousnotetonous
提出日時 2016-04-17 23:10:32
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 671 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 21,504 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 02:26:01
合計ジャッジ時間 721 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 0 ms
6,944 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 0 ms
6,940 KB
testcase_08 AC 0 ms
6,944 KB
testcase_09 AC 0 ms
6,944 KB
testcase_10 AC 0 ms
6,940 KB
testcase_11 AC 0 ms
6,944 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 AC 0 ms
6,944 KB
testcase_14 AC 0 ms
6,944 KB
testcase_15 AC 1 ms
6,940 KB
testcase_16 AC 0 ms
6,940 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 AC 0 ms
6,944 KB
testcase_19 AC 0 ms
6,944 KB
testcase_20 AC 0 ms
6,940 KB
testcase_21 AC 0 ms
6,940 KB
testcase_22 AC 0 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |     scanf("%d",&a[i]);
      |     ^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
int main(){
  int a[3];
  int b[3];
  int p;
  int count=0;
  int i,j;
  int z;
  int min=1000,max=1;
  for(i=0;i<3;i++){
    scanf("%d",&a[i]);
    if(max<a[i])max=a[i];
    if(min>a[i])min=a[i];
  }
  z=max;

  if(a[0]==a[2] || a[1]==a[2] || a[0]==a[2]){printf("0\n");return 0;}
  if(a[1]==min || a[1]==max){printf("INF\n");return 0;}
  for(p=1;p<=z;p++){
    b[0]=a[0]%p;
    b[1]=a[1]%p;
    b[2]=a[2]%p;
    max=b[0];
    min=b[0];
    for(i=0;i<3;i++){
      if(max<b[i])max=b[i];
      if(min>b[i])min=b[i];
    }
    if((max==b[1] || min==b[1]) && (b[0]!=b[2]) && (b[0]!=b[1]) && (b[1]!=b[2]))count++;
  }

  printf("%d\n",count);
  return 0;
}
0