結果

問題 No.2835 Take and Flip
コンテスト
ユーザー makichan
提出日時 2024-08-10 09:33:46
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 489 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,117 ms
コンパイル使用メモリ 375,244 KB
実行使用メモリ 7,976 KB
最終ジャッジ日時 2026-04-03 20:44:17
合計ジャッジ時間 5,905 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:20:10: warning: 's' may be used uninitialized [-Wmaybe-uninitialized]
   20 |         s+=a;
      |         ~^~~
main.cpp:16:8: note: 's' was declared here
   16 |     ll s;
      |        ^

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#include <atcoder/all>
using mint = atcoder::static_modint<998244353>;
//using mint = atcoder::static_modint<1000000007>;
using namespace std;
using namespace atcoder;
using ld = long double;
using ll = long long;
#define mp(a,b) make_pair(a,b)
#define rep(i,s,n) for(int i=s; i<n; i++)
const vector<int> dx{1,0,-1,0},dy{0,1,0,-1};

int main(){
    int n;
    cin >> n;
    ll s;
    rep(i,0,n){
        ll a;
        cin >> a;
        s+=a;
    }
    cout << s;
}
0