結果
| 問題 |
No.723 2つの数の和
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-03 22:37:47 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 67 ms / 2,000 ms |
| コード長 | 294 bytes |
| コンパイル時間 | 1,552 ms |
| コンパイル使用メモリ | 175,040 KB |
| 実行使用メモリ | 9,856 KB |
| 最終ジャッジ日時 | 2024-09-19 17:31:06 |
| 合計ジャッジ時間 | 3,140 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
int a[200000];
int main(){
int n,x;scanf("%d%d",&n,&x);
map<int,int>mp;
rep(i,n){
scanf("%d",&a[i]);
mp[a[i]]++;
}
ll cnt=0;
rep(i,n){
cnt+=mp[x-a[i]];
}
cout<<cnt<<endl;
}