結果

問題 No.723 2つの数の和
ユーザー _aoken_aoken
提出日時 2020-12-06 19:08:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 515 bytes
コンパイル時間 1,743 ms
コンパイル使用メモリ 179,164 KB
実行使用メモリ 13,464 KB
最終ジャッジ日時 2023-10-17 15:29:05
合計ジャッジ時間 3,930 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,348 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 95 ms
11,028 KB
testcase_14 AC 21 ms
6,144 KB
testcase_15 AC 39 ms
7,696 KB
testcase_16 AC 58 ms
9,164 KB
testcase_17 AC 77 ms
10,192 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
4,348 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0