結果

問題 No.9 モンスターのレベル上げ
ユーザー SugihaMSugihaM
提出日時 2020-04-18 11:34:19
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 573 bytes
コンパイル時間 826 ms
コンパイル使用メモリ 32,768 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-14 20:38:43
合計ジャッジ時間 23,916 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 2,449 ms
6,940 KB
testcase_03 AC 1,711 ms
6,940 KB
testcase_04 AC 724 ms
6,944 KB
testcase_05 AC 405 ms
6,940 KB
testcase_06 AC 87 ms
6,940 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 130 ms
6,940 KB
testcase_09 AC 2,378 ms
6,944 KB
testcase_10 WA -
testcase_11 AC 2,458 ms
6,940 KB
testcase_12 WA -
testcase_13 AC 2,666 ms
6,944 KB
testcase_14 AC 2,351 ms
6,944 KB
testcase_15 AC 2,136 ms
6,940 KB
testcase_16 AC 7 ms
6,940 KB
testcase_17 AC 1,104 ms
6,944 KB
testcase_18 AC 840 ms
6,944 KB
testcase_19 AC 5 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<math.h>

int main(){
	int a[1500],b[1500],e[1500],i,j,k,n,l,m,ans;
	scanf("%d",&n);
	for(i = 0;i < n; i++){
    scanf("%d", a+i);
  }
	for(i=0;i<n;i++){
    scanf("%d", b+i);
  }
	ans = n;
	for(i = 0;i < n;i++){
		for(j = 0;j < n;j++){
      e[j] = a[j] * n;
    }
		for(j = 0;j < n;j++){
			for(l = k = 0;k < n; k++){
        if(e[k] < e[l]){
          l = k;
        }
      }
      e[l] += b[(i+j)%n]/2*n+1;
		}
		for(m = j= 0;j < n;j++){
      m = fmax(m,e[j]%n);
    }
		if(ans > m){
      ans = m;
    }
	}
	printf("%d\n",ans);
	return 0;
}
0