結果
| 問題 | No.723 2つの数の和 |
| コンテスト | |
| ユーザー |
taichi_hobbies
|
| 提出日時 | 2019-06-02 14:48:18 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 618 bytes |
| 記録 | |
| コンパイル時間 | 2,729 ms |
| コンパイル使用メモリ | 83,060 KB |
| 実行使用メモリ | 53,924 KB |
| 最終ジャッジ日時 | 2026-04-06 10:49:40 |
| 合計ジャッジ時間 | 5,775 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 RE * 1 |
| other | AC * 4 WA * 2 RE * 16 |
ソースコード
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 a[] = new int[N];
int t[] = new int[N + 1];
int result = 0;
for (int i = 0; i < N; i++) {
a[i] = sc.nextInt();
t[a[i]]++;
}
for (int i = 0; i < N; i++) {
if (X - a[i] >= 0 && 100000 >= X - a[i]) {
result += t[X - a[i]];
}
}
// long end = System.currentTimeMillis();
// System.out.println((end - start) + "ms");
System.out.println(result);
}
}
taichi_hobbies