結果

問題 No.723 2つの数の和
ユーザー taichi_hobbies
提出日時 2019-06-02 14:29:13
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 661 bytes
コンパイル時間 3,603 ms
コンパイル使用メモリ 74,584 KB
実行使用メモリ 76,316 KB
最終ジャッジ日時 2024-09-17 20:11:04
合計ジャッジ時間 7,632 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other TLE * 1 -- * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Question723 {
	public static void main(String[] args) {

		//long start = System.currentTimeMillis();

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int result = 0;

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

		for (int i = 0; i < N; i++) {
			for (int j = i; j < N; j++) {
				if (X == Arys[i] + Arys[j]) {
					if (i == j) {
						result += 1;
					} else {
						result += 2;
					}

				}
			}

		}
		//		long end = System.currentTimeMillis();
		//	System.out.println((end - start) + "ms");
		System.out.println(result);
	}
}
0