結果
| 問題 |
No.723 2つの数の和
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-18 11:18:52 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 365 bytes |
| コンパイル時間 | 642 ms |
| コンパイル使用メモリ | 69,552 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-01 13:46:07 |
| 合計ジャッジ時間 | 1,672 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 WA * 2 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main(void) {
int num, x, b, i, ans = 0;
cin >> num >> x;
vector<int> d(100001, 0), a(num);
for (i = 0; i < num; i++) {
scanf("%d", &a[i]);
d[a[i]]++;
}
for (i = 0; i < num; i++) {
b = x - a[i];
if (b >= 0 && b <= 100000 && d[b] > 0)
ans += d[b];
}
cout << ans << "\n";
return 0;
}