結果

問題 No.2684 折々の色
ユーザー tentententen
提出日時 2024-03-25 10:43:34
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 2,090 bytes
コンパイル時間 2,271 ms
コンパイル使用メモリ 78,248 KB
実行使用メモリ 77,712 KB
最終ジャッジ日時 2024-03-25 10:43:44
合計ジャッジ時間 9,504 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
60,784 KB
testcase_01 AC 50 ms
51,916 KB
testcase_02 AC 57 ms
53,984 KB
testcase_03 AC 52 ms
53,996 KB
testcase_04 AC 62 ms
54,124 KB
testcase_05 AC 51 ms
53,988 KB
testcase_06 AC 55 ms
53,988 KB
testcase_07 AC 51 ms
53,980 KB
testcase_08 AC 57 ms
53,988 KB
testcase_09 AC 54 ms
53,988 KB
testcase_10 AC 54 ms
54,000 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.util.function.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] target = new int[m];
        for (int i = 0; i < m; i++) {
            target[i] = sc.nextInt();
        }
        int[][] colors = new int[n][m];
        int[] base = new int[n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                colors[i][j] = sc.nextInt();
            }
            base[i] = sc.nextInt();
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (i == j) {
                    continue;
                }
                boolean enable = true;
                for (int k = 0; k < m && enable; k++) {
                    enable = (target[k] * 10000 == colors[i][k] * base[i] * 100 + colors[j][k] * (100 - base[i]) * base[j]);
                }
                if (enable) {
                    System.out.println("Yes");
                    return;
                }
            }
        }
        System.out.println("No");
    }
}
class Scanner {
    BufferedReader br;
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
        } catch (Exception e) {
            
        }
    }
    
    public int nextInt() {
        return Integer.parseInt(next());
    }
    
    public long nextLong() {
        return Long.parseLong(next());
    }
    
    public double nextDouble() {
        return Double.parseDouble(next());
    }
    
    public String next() {
        try {
            while (!st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            return st.nextToken();
        }
    }
    
}
0