結果
問題 |
No.3302 Sense Battle
|
ユーザー |
|
提出日時 | 2025-10-05 16:20:37 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 767 bytes |
コンパイル時間 | 799 ms |
コンパイル使用メモリ | 99,676 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-10-05 16:20:49 |
合計ジャッジ時間 | 1,497 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 WA * 17 |
ソースコード
#include <iostream> #include <iomanip> #include <vector> #include <algorithm> #include <utility> #include <string> #include <queue> #include <stack> #include <unordered_set> #include <unordered_map> #include <numeric> using namespace std; typedef long long int ll; typedef pair<int, int> Pii; const ll mod = 998244353; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<ll> a(n), b(n); for (int i = 0; i < n; i++) { cin >> a[i] >> b[i]; } ll score = accumulate(b.begin(), b.end(), 0LL); ll atk = 0; for (int i = 0; i < n; i++) { ll score_delta = a[i] * (n - i - 1) - (atk + b[i]); if (score_delta > 0) { score += score_delta; atk += a[i]; } } cout << score << endl; return 0; }