結果
| 問題 | 
                            No.339 何人が回答したのか
                             | 
                    
| コンテスト | |
| ユーザー | 
                             takatowin
                         | 
                    
| 提出日時 | 2017-01-21 20:46:29 | 
| 言語 | C90  (gcc 12.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 430 bytes | 
| コンパイル時間 | 406 ms | 
| コンパイル使用メモリ | 21,888 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-23 04:27:55 | 
| 合計ジャッジ時間 | 2,029 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 40 WA * 21 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:19:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   19 | scanf("%d",&n);
      | ^~~~~~~~~~~~~~
main.c:22:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   22 |   scanf("%d",&a[i]);
      |   ^~~~~~~~~~~~~~~~~
            
            ソースコード
#include<stdio.h>
#include<string.h>
int max(int a,int b){
  int x=1,i;
  if(a>b){
    int temp;
    temp=a;
    a=b;
    b=temp;
  }
  for(i=1;i<=a;i++)
    if(a%i==0 && b%i==0){
      x=i;
    }
  return x;
}
int main(void){
int n,temp=1;
scanf("%d",&n);
int a[n],i;
for(i=0;i<n;i++)
  scanf("%d",&a[i]);
if(n==1){
  printf("1\n");
  return 0;
}
for(i=0;i<n-1;i++)
  temp=max(a[i],a[i+1]);
printf("%d\n",100/temp);
return 0;
}
            
            
            
        
            
takatowin