結果
| 問題 |
No.723 2つの数の和
|
| コンテスト | |
| ユーザー |
🍮かんプリン
|
| 提出日時 | 2019-02-10 15:28:03 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 372 bytes |
| コンパイル時間 | 1,211 ms |
| コンパイル使用メモリ | 159,168 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-06 10:16:03 |
| 合計ジャッジ時間 | 2,376 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 WA * 9 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
int a[100001];
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll x;
int n,c=0,p,m=0;
cin >> n >> x;
for (int i=0;i<n;i++) { cin>>p; a[p]++; m=m<p?p:m;}
for (int i=0;i<=m;i++) {
if (x-i<=m&&x>=m) c+=a[x-i]*a[i];
}
cout << c << endl;
return 0;
}
🍮かんプリン