結果

問題 No.759 悪くない忘年会にしような!
ユーザー hiromi_ayasehiromi_ayase
提出日時 2018-12-07 17:54:05
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 3,168 bytes
コンパイル時間 2,513 ms
コンパイル使用メモリ 89,488 KB
実行使用メモリ 59,856 KB
最終ジャッジ日時 2024-09-14 03:26:46
合計ジャッジ時間 22,044 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
45,516 KB
testcase_01 AC 91 ms
39,924 KB
testcase_02 AC 92 ms
40,300 KB
testcase_03 AC 91 ms
40,172 KB
testcase_04 AC 91 ms
40,072 KB
testcase_05 AC 90 ms
40,140 KB
testcase_06 AC 92 ms
40,084 KB
testcase_07 AC 92 ms
40,228 KB
testcase_08 AC 91 ms
40,088 KB
testcase_09 AC 91 ms
40,200 KB
testcase_10 AC 90 ms
39,956 KB
testcase_11 AC 89 ms
39,796 KB
testcase_12 AC 91 ms
40,184 KB
testcase_13 AC 92 ms
40,004 KB
testcase_14 AC 93 ms
40,248 KB
testcase_15 AC 92 ms
39,964 KB
testcase_16 AC 90 ms
40,168 KB
testcase_17 AC 91 ms
40,204 KB
testcase_18 AC 90 ms
39,948 KB
testcase_19 AC 92 ms
40,320 KB
testcase_20 AC 92 ms
40,204 KB
testcase_21 AC 92 ms
40,224 KB
testcase_22 AC 92 ms
40,252 KB
testcase_23 AC 92 ms
40,148 KB
testcase_24 AC 94 ms
40,468 KB
testcase_25 AC 93 ms
39,932 KB
testcase_26 AC 91 ms
40,096 KB
testcase_27 AC 92 ms
40,212 KB
testcase_28 AC 93 ms
39,968 KB
testcase_29 AC 93 ms
40,112 KB
testcase_30 AC 92 ms
40,336 KB
testcase_31 AC 92 ms
40,024 KB
testcase_32 AC 90 ms
39,972 KB
testcase_33 AC 212 ms
46,032 KB
testcase_34 AC 130 ms
41,380 KB
testcase_35 AC 173 ms
42,868 KB
testcase_36 AC 206 ms
45,540 KB
testcase_37 AC 144 ms
41,508 KB
testcase_38 AC 221 ms
46,212 KB
testcase_39 AC 147 ms
41,504 KB
testcase_40 AC 194 ms
45,072 KB
testcase_41 AC 211 ms
45,844 KB
testcase_42 AC 213 ms
46,240 KB
testcase_43 AC 243 ms
47,236 KB
testcase_44 AC 504 ms
54,060 KB
testcase_45 AC 539 ms
54,140 KB
testcase_46 AC 604 ms
54,036 KB
testcase_47 AC 567 ms
54,080 KB
testcase_48 AC 576 ms
54,156 KB
testcase_49 AC 229 ms
47,156 KB
testcase_50 AC 225 ms
46,896 KB
testcase_51 AC 228 ms
47,496 KB
testcase_52 AC 236 ms
47,372 KB
testcase_53 AC 562 ms
53,836 KB
testcase_54 AC 567 ms
53,828 KB
testcase_55 AC 555 ms
53,872 KB
testcase_56 AC 540 ms
54,024 KB
testcase_57 AC 600 ms
53,904 KB
testcase_58 AC 589 ms
53,956 KB
testcase_59 AC 538 ms
54,040 KB
testcase_60 AC 564 ms
54,076 KB
testcase_61 AC 560 ms
53,996 KB
testcase_62 AC 561 ms
54,088 KB
testcase_63 TLE -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;

public class Main {
  private static void solve() {

    int n = ni();
    int[][] p = new int[n][4];
    for (int i = 0; i < n; i++) {
      p[i] = new int[] {i, ni(), ni(), ni()};
    }
    for (int v : solve2(p)) {
      out.println(v + 1 + " ");
    }
  }

  private static int[] solve2(int[][] p) {
    int n = p.length;
    boolean[] ng = new boolean[n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (i == j)
          continue;

        if (p[i][1] <= p[j][1] && p[i][2] <= p[j][2] && p[i][3] <= p[j][3]) {
          ng[p[i][0]] = true;
          break;
        }
      }
    }

    int[] ret = new int[n];
    int ptr = 0;
    for (int i = 0; i < n; i++) {
      if (!ng[i]) {
        ret[ptr++] = i;
      }
    }
    return Arrays.copyOf(ret, ptr);
  }



  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}
0