結果

問題 No.2835 Take and Flip
ユーザー get_tanniget_tanni
提出日時 2024-08-09 21:26:32
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 2,612 bytes
コンパイル時間 8,168 ms
コンパイル使用メモリ 350,736 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-08-09 21:26:43
合計ジャッジ時間 9,856 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 81 ms
5,376 KB
testcase_04 AC 86 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 72 ms
5,376 KB
testcase_07 AC 74 ms
5,376 KB
testcase_08 AC 69 ms
5,376 KB
testcase_09 AC 86 ms
5,376 KB
testcase_10 AC 80 ms
5,376 KB
testcase_11 AC 80 ms
5,376 KB
testcase_12 AC 87 ms
5,376 KB
testcase_13 AC 78 ms
5,376 KB
testcase_14 AC 33 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 53 ms
5,376 KB
testcase_17 AC 8 ms
5,376 KB
testcase_18 AC 63 ms
5,376 KB
testcase_19 AC 74 ms
5,376 KB
testcase_20 AC 29 ms
5,376 KB
testcase_21 AC 78 ms
5,376 KB
testcase_22 AC 53 ms
5,376 KB
testcase_23 AC 25 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
#include <atcoder/all>

using std::cout; using namespace std; using ll=long long; using ld=long double; using P=array<ll,2>;
#define rep(i,n) for (ll i=0,siz=(n);i<siz;i++)
#define rep2(i,a,b) for (ll i=(a),siz=(b);i<siz;i++)
#define repd(i,a,b) for (ll i=(a),siz=(b);i>=siz;i--)
#define popcount __builtin_popcountll
#define cin(a) ll a; cin >> a;
#define cin2(a,b) ll a,b; cin >> a >> b;
#define cin3(a,b,c) ll a,b,c; cin >> a >> b >> c;
#define cinvec(v) vector<ll> v(N); rep(i,N) cin >> v[i];
#define cinvec2(v,n) vector<ll> v(n); rep(i,n) cin >> v[i];
#define cins(s) string s; cin >> s;
#define cinc(c) char c; cin >> c;
#define seg_RaRmax atcoder::lazy_segtree<ll, [&](ll a, ll b){ return max(a,b);},[&](){return 0;},ll,[&](ll m, ll n){ return m+n;}, [&](ll a, ll b){return a+b;},[&](){return 0;}>
#define seg_RaRsum atcoder::lazy_segtree<array<ll,2>, [&](array<ll,2> a, array<ll,2> b){ return array<ll,2>{a[0]+b[0],a[1]+b[1]};},[&](){return array<ll,2>{0,0};},ll,[&](ll m, array<ll,2> n){ return array<ll,2>{m[0]+n*m[1],m[1]};}, [&](ll a, ll b){return a+b;},[&](){return 0;}>
vector<ll> dx = {0,-1,0,1},dy = {1,0,-1,0}, ddx = {0,-1,-1,-1,0,1,1,1}, ddy = {1,1,0,-1,-1,-1,0,1};
void yesno(bool b) {cout << (b?"Yes":"No") << endl;}
template<class T> void sortunique(vector<T> &V) {sort(V.begin(), V.end()); V.erase(unique(V.begin(), V.end()), V.end());}
template<typename T> void outvec(const std::initializer_list<T>& list) { bool first = true; for (const auto& elem : list) 
{ if (!first) std::cout << " "; std::cout << elem; first = false; } std::cout << std::endl; }
template<typename T> void outvec(const std::vector<T>& vec) { bool first = true; for (const auto& elem : vec) 
{ if (!first) std::cout << " "; std::cout << elem; first = false; } std::cout << std::endl; }
template<typename T, size_t N> void outvecp(const std::vector<std::array<T,N>>& vec) { bool first = true; for (const auto& elem : vec) 
{ if (!first) std::cout << " "; for (int i = 0; i < N; i++) std::cout << elem[i] << " "; first = false; } std::cout << std::endl; }
vector<ll> compress(vector<ll> &A){vector<ll> B = A; sortunique(B); rep(i,A.size()) A[i] = lower_bound(B.begin(),B.end(),A[i]) - B.begin(); return B;}
ll bs(ll l, ll r, function<bool(ll)> f) { while (r-l > 1) { ll m = (l+r)/2; if (f(m)) r = m; else l = m; } return r; }
ll msb(ll N) { assert(N>0); return 63 - __builtin_clzll(N); }


int main() {
    cin(N); cinvec(A);
    cout << accumulate(A.begin(),A.end(),0LL) << endl;
    
    return 0;
} 
0