結果
| 問題 |
No.723 2つの数の和
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-09-04 20:51:27 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 326 bytes |
| コンパイル時間 | 1,454 ms |
| コンパイル使用メモリ | 159,484 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-15 17:06:50 |
| 合計ジャッジ時間 | 2,898 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 8 WA * 14 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define MAXVAL 100000
signed main(){
int N, X, a[MAXVAL+100] = {}, A, ans = 0;
cin>>N>>X;
for(int i = 1; i <= N; i++)
cin>>A;
a[A]++;
for(int i = 0; i <= MAXVAL; i++)
if(X-i <= MAXVAL) ans += a[i]*a[X-i];
cout<<ans<<endl;
return 0;
}