結果
問題 | No.723 2つの数の和 |
ユーザー | peroon |
提出日時 | 2019-04-04 18:41:18 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,079 bytes |
コンパイル時間 | 787 ms |
コンパイル使用メモリ | 101,528 KB |
実行使用メモリ | 491,008 KB |
最終ジャッジ日時 | 2023-08-26 21:51:11 |
合計ジャッジ時間 | 5,914 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,376 KB |
testcase_02 | AC | 2 ms
4,380 KB |
testcase_03 | AC | 41 ms
7,956 KB |
testcase_04 | AC | 79 ms
11,972 KB |
testcase_05 | AC | 87 ms
13,960 KB |
testcase_06 | AC | 50 ms
8,668 KB |
testcase_07 | AC | 26 ms
6,868 KB |
testcase_08 | AC | 31 ms
7,580 KB |
testcase_09 | AC | 45 ms
8,084 KB |
testcase_10 | AC | 50 ms
10,752 KB |
testcase_11 | AC | 18 ms
6,784 KB |
testcase_12 | AC | 29 ms
7,132 KB |
testcase_13 | TLE | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
ソースコード
#include<algorithm> #include<complex> #include<ctype.h> #include<iomanip> #include<iostream> #include<fstream> #include<map> #include<math.h> #include<numeric> #include<queue> #include<set> #include<stack> #include<stdio.h> #include<string> #include<string> #include<vector> using namespace std; typedef long long ll; #define FOR(i,a,b) for(ll i=(a);i<(b);++i) #define ALL(v) (v).begin(), (v).end() #define p(s) cout<<(s)<<endl #define p2(s, t) cout << (s) << " " << (t) << endl #define br() p("") #define pn(s) cout << (#s) << " " << (s) << endl #define p_yes() p("Yes") #define p_no() p("No") const ll mod = 1e9 + 7; const ll inf = 1e18; template < typename T > void vprint(T &V){ for(auto v : V){ cout << v << " "; } cout << endl; } int main(){ cin.tie(0); ios::sync_with_stdio(false); // input ll N, X; cin >> N >> X; map<ll, ll> mp; FOR(i, 0, N){ ll a; cin >> a; mp[a]++; } ll sum = 0; FOR(i, 0, X+1){ ll a = X - i; sum += mp[i] * mp[a]; } p(sum); return 0; }