結果

問題 No.723 2つの数の和
ユーザー Hdz06052373
提出日時 2018-08-13 03:10:54
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 645 bytes
コンパイル時間 2,167 ms
コンパイル使用メモリ 74,800 KB
実行使用メモリ 76,564 KB
最終ジャッジ日時 2024-09-24 07:41:13
合計ジャッジ時間 6,013 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other TLE * 1 -- * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
// import java.util.List;
// import java.util.ArrayList;

class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
//         List<Integer> a = new ArrayList<Integer>();
        int count = 0, N, X;
        N = sc.nextInt();
        X = sc.nextInt();
        int[] a = new int[N];

        for (int i = 0; i < N; i++) {
            a[i] = sc.nextInt();
        }

        for (Integer i : a) {
            for (Integer j: a) {
                if (i+j == X) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}
0