結果
問題 |
No.723 2つの数の和
|
ユーザー |
![]() |
提出日時 | 2019-06-02 14:48:18 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 618 bytes |
コンパイル時間 | 3,549 ms |
コンパイル使用メモリ | 75,008 KB |
実行使用メモリ | 59,316 KB |
最終ジャッジ日時 | 2024-09-17 20:11:21 |
合計ジャッジ時間 | 7,689 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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); } }