結果
| 問題 |
No.723 2つの数の和
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-06-03 12:44:21 |
| 言語 | Java (openjdk 23) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 737 bytes |
| コンパイル時間 | 2,083 ms |
| コンパイル使用メモリ | 74,492 KB |
| 実行使用メモリ | 69,608 KB |
| 最終ジャッジ日時 | 2024-09-17 20:24:24 |
| 合計ジャッジ時間 | 6,245 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 21 |
ソースコード
import java.util.*;
public class Main{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
String nx = sc.nextLine();
String nums = sc.nextLine();
String[] nxArr = nx.split(" ");
String[] numsArr = nums.split(" ");
int inputCount = Integer.parseInt(nxArr[0]);
int sum = Integer.parseInt(nxArr[1]);
int[] numArr = new int[inputCount];
for (int i=0;i<inputCount;i++){
numArr[i] = Integer.parseInt(numsArr[i]);
}
int count = 0;
for (int i=0;i<inputCount;i++){
for(int j=0;j<inputCount;j++){
if (sum == numArr[i] + numArr[j])
count++;
}
}
System.out.println(count);
}
}