結果
| 問題 |
No.1389 Clumsy Calculation
|
| コンテスト | |
| ユーザー |
trineutron
|
| 提出日時 | 2021-02-12 21:25:53 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 101 ms / 2,000 ms |
| コード長 | 298 bytes |
| コンパイル時間 | 1,951 ms |
| コンパイル使用メモリ | 193,592 KB |
| 最終ジャッジ日時 | 2025-01-18 17:56:51 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x;
cin >> n >> x;
vector<int> s(n);
for (int i = 0; i < n; i++) {
cin >> s.at(i);
}
int64_t ans = accumulate(s.begin(), s.end(), int64_t());
ans -= int64_t(n - 1) * x;
cout << ans << endl;
}
trineutron