結果

問題 No.2835 Take and Flip
ユーザー Spica08
提出日時 2024-08-13 11:27:49
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 868 bytes
コンパイル時間 1,206 ms
コンパイル使用メモリ 103,172 KB
最終ジャッジ日時 2025-02-23 22:43:05
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <bitset>
#include <cctype>
#include <functional>
#include <cassert>
using namespace std;

#define REP(i, n) for (int i = 0; i < (int)(n); i++)

using ll = long long;
using ull = unsigned long long;
using Matrix = std::vector<std::vector<ll>>;
const int inf = 1000000000;
const ll INF = 1000000000000000000;
const ll mod = 998244353;
const ull mod_hash = (1UL << 61) - 1;
const std::vector<int> dx = {0, 1, 0, -1, 1, 1, -1, -1};
const std::vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};

int main(){
  int N; cin >> N;
  vector<ll> A(N);
  REP(i, N) cin >> A[i];
  sort(A.begin(), A.end());
  ll ans = 0;
  REP(i, N) ans += A[i];
  cout << ans << endl;
  return 0;
}
0