結果
問題 | No.723 2つの数の和 |
ユーザー |
![]() |
提出日時 | 2020-12-06 19:08:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 515 bytes |
コンパイル時間 | 1,679 ms |
コンパイル使用メモリ | 179,224 KB |
実行使用メモリ | 13,376 KB |
最終ジャッジ日時 | 2024-09-17 13:10:20 |
合計ジャッジ時間 | 3,772 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 6 WA * 16 |
ソースコード
#include<bits/stdc++.h> #define rep(i, s, n) for (long long i = s; i < (int)(n); i++) #define all(a) a.begin(), a.end() #define put(i) cout<<fixed<<i<<endl #define putl(a) for(auto x:a)cout<<x<<' '; cout<<endl using namespace std; using ll = long long; int main(){ ll n, x; cin >> n >> x; vector<ll> a(n); rep(i,0,n) cin >> a[i]; map<ll,ll> mp; rep(i,0,n){ mp[a[i] + 2]++; } a.push_back(a[0]); rep(i,0,n){ mp[a[i] + a[i+1]]+=2; } cout << mp[x] << endl; }