結果
| 問題 | No.3613 Legendary Bread Maker |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-07 10:24:36 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| + 245µs | |
| コード長 | 1,219 bytes |
| 記録 | |
| コンパイル時間 | 2,431 ms |
| コンパイル使用メモリ | 330,324 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-07 10:24:41 |
| 合計ジャッジ時間 | 4,112 ms |
|
ジャッジサーバーID (参考情報) |
judge1_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>
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pob pop_back
#define eb emplace_back
#define nall(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define yesno(a) cout<<(a?"Yes\n":"No\n")
#define lb lower_bound
#define ub lower_bound
#define yes cout<<"Yes\n"
#define no cout<<"No\n"
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<class T> using pq = priority_queue<T>;
template<class T> using pqg = priority_queue<T, vector<T>, greater<T>>;
template<class T> using vec = vector<T>;
template<class T> using vv = vector<vector<T>>;
template<class T> using vvv = vector<vv<T>>;
template<class T> using vvvv = vector<vvv<T>>;
template<class T> using vvvvv = vector<vvvv<T>>;
void solve();
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
unsigned T = 1;
// cin >> T;
cout << fixed << setprecision(20);
while (T--) solve();
return 0;
}
void solve(){
int N;
cin >> N;
ll S = 0, T = 0;
rep(i, N){
int x;
cin >> x;
S += x;
T += x*x;
}
S *= S;
cout << (S-T)/2 << endl;
}