結果
問題 |
No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
|
ユーザー |
![]() |
提出日時 | 2020-10-22 20:33:39 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 81 ms / 2,000 ms |
コード長 | 1,014 bytes |
コンパイル時間 | 1,540 ms |
コンパイル使用メモリ | 169,756 KB |
実行使用メモリ | 7,168 KB |
最終ジャッジ日時 | 2024-07-21 09:32:38 |
合計ジャッジ時間 | 3,586 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 15 |
ソースコード
#include<bits/stdc++.h> // #include <atcoder/all> #define rep(i,n) for(int i = 0;i<n;i++) using namespace std; // using namespace atcoder; typedef pair<int,int> P; typedef long long ll; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0;} template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0;} // using mint = modint1000000007; // struct combination { // vector<mint> fact,ifact; // combination(int n): fact(n+1),ifact(n+1) { // fact[0] = 1; // for(int i = 1; i <= n;i++) fact[i] = fact[i-1]*i; // ifact[n] = fact[n].inv(); // for(int i = n;i>=1;i--) ifact[i-1] = ifact[i]*i; // } // mint operator ()(int n,int k) { // if(k < 0 || k > n) return 0; // return fact[n]*ifact[k]*ifact[n-k]; // } // }; int main() { int n; cin >> n; vector<ll>a(n); rep(i,n) cin >> a[i]; ll ans = 0; rep(i,n) { ans += a[i]; } cout << ans << endl; }