結果
| 問題 | No.3613 Legendary Bread Maker |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-06 21:24:49 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| + 968µs | |
| コード長 | 433 bytes |
| 記録 | |
| コンパイル時間 | 2,390 ms |
| コンパイル使用メモリ | 331,984 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-06 21:24:53 |
| 合計ジャッジ時間 | 3,487 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| サンプル | 0 % | AC * 3 |
| 小課題1 | 10 % | AC * 5 |
| 小課題2 | 40 % | AC * 13 |
| 小課題3 | 50 % | AC * 23 |
| 合計 | 2 * 100% = 200 点 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int n;
cin >> n;
ll s = 0;
vector<ll> a(n);
rep(i, n) {
cin >> a[i];
s += a[i];
}
ll ans = 0;
rep(i, n) {
ans += a[i] * (s - a[i]);
}
cout << ans / 2 << endl;
return 0;
}