結果

問題 No.507 ゲーム大会(チーム決め)
ユーザー bennkei0327bennkei0327
提出日時 2017-04-27 23:59:45
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 1,074 bytes
コンパイル時間 1,409 ms
コンパイル使用メモリ 28,912 KB
実行使用メモリ 6,048 KB
最終ジャッジ日時 2023-10-11 16:13:16
合計ジャッジ時間 6,281 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,372 KB
testcase_01 AC 0 ms
4,368 KB
testcase_02 AC 1 ms
4,368 KB
testcase_03 WA -
testcase_04 AC 0 ms
4,372 KB
testcase_05 AC 1 ms
4,372 KB
testcase_06 WA -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 0 ms
4,372 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>

int main(void)
{
  int N, M;
  int a[100000]; //得点
  int b[1000][1000];
  int c[100000];
  int p,q,i,j,w,h,r;
  
  
  scanf("%d %d", &N, &M);

  int acount = 0;

  
  for(i = 0; i < N ; i++){
    scanf("%d", &a[i]);
  }

  i = 0;
  j = 0;
  p = 1;
  w = 0;
 
  for(i = 0, p = 1; i < N-1; i++){
    for(j = 1; j <= N-p; j++){
      b[i][j] = a[i] + a[j];
    }
    p--;
  }

 


 /* printf("\n\n");
  i = 0;
  q = 1;
  for(i = 0,p = 1; i < N-1; i++){
    for(j = q; j < N; j++){
      printf("b[%d][%d] = %d     : %d\n",i, j, b[i][j], w+1);
      w++;
    }
    q++;
    }*/
  
  i = 0;
  q = 1;
  r = 1;
  h = 1;
  w = 10000000;
  
  while(1){
    
    if(h == 8){
      break;
    }
    
    for(i = 0,p = 1; i < N-1; i++){
      for(j = q; j < N; j++){
	if(i != 0 && i != h && j != h){ 
	  if(b[0][h] < b[i][j]){
	    r++;
	  }
	}
      }
      
      q++;
    }
    
    if(M >= r){
      if(w > a[h]){
	w = a[h];
      }
    }
    
    h++;
    r = 1;
    q = 1;
  }
  
  if(w == 10000000){
    w = -1;
  }

  printf("%d\n", w);

  
  return 0;
}
0