結果

問題 No.2652 [Cherry 6th Tune N] Δρονε χιρχλινγ
ユーザー 👑 chro_96chro_96
提出日時 2024-02-25 20:02:26
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 959 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 30,464 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-25 20:02:56
合計ジャッジ時間 27,789 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,120 KB
testcase_01 AC 111 ms
5,120 KB
testcase_02 AC 112 ms
6,676 KB
testcase_03 AC 113 ms
6,676 KB
testcase_04 AC 121 ms
6,676 KB
testcase_05 AC 121 ms
6,676 KB
testcase_06 AC 121 ms
6,676 KB
testcase_07 AC 130 ms
6,676 KB
testcase_08 AC 128 ms
6,676 KB
testcase_09 AC 131 ms
6,676 KB
testcase_10 AC 128 ms
6,676 KB
testcase_11 AC 131 ms
6,676 KB
testcase_12 AC 128 ms
6,676 KB
testcase_13 AC 132 ms
6,676 KB
testcase_14 WA -
testcase_15 AC 131 ms
6,676 KB
testcase_16 AC 130 ms
6,676 KB
testcase_17 AC 133 ms
6,676 KB
testcase_18 AC 133 ms
6,676 KB
testcase_19 AC 131 ms
6,676 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 104 ms
6,676 KB
testcase_41 AC 100 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>

int cmp_int_2d (const void *a, const void *b) {
  int *a_ = (int *)a;
  int *b_ = (int *)b;
  
  if (a_[0] < b_[0]) {
    return -1;
  }
  
  if (a_[0] > b_[0]) {
    return 1;
  }
  
  if (a_[1] < b_[1]) {
    return -1;
  }
  
  if (a_[1] > b_[1]) {
    return 1;
  }
  
  return 0;
}

int main () {
  int t = 0;
  int n = 0;
  int l = 0;
  int xy[200000][3] = {};
  
  int res = 0;
  
  res = scanf("%d", &t);
  while (t > 0) {
    int b = 1;
    res = scanf("%d", &n);
    res = scanf("%d", &l);
    for (int i = 0; i < n; i++) {
      res = scanf("%d", xy[i]);
      res = scanf("%d", xy[i]+1);
    }
    while (b*b < n) {
      b++;
    }
    for (int i = 0; i < n; i++) {
      xy[i][2] = xy[i][0];
      xy[i][0] /= 1+l/b;
    }
    qsort(xy, n, sizeof(int)*3, cmp_int_2d);
    printf("%d\n", n);
    for (int i = 0; i < n; i++) {
      printf("%d %d\n", xy[i][2], xy[i][1]);
    }
    t--;
  }
  
  return 0;
}
0