結果

問題 No.3613 Legendary Bread Maker
コンテスト
ユーザー keisuke6
提出日時 2026-08-06 14:11:19
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 8 ms / 2,000 ms
+ 885µs
コード長 342 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,089 ms
コンパイル使用メモリ 211,016 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-08-06 14:11:34
合計ジャッジ時間 2,471 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
サブタスク 配点 結果
サンプル 0 % AC * 3
小課題1 10 % AC * 5
小課題2 40 % AC * 13
小課題3 50 % AC * 23
合計 2 * 100% = 200 点
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	std::cout.tie(nullptr);
	srand((unsigned)time(NULL));
	int N;
	cin>>N;
	vector<int> A(N);
	int s = 0, t = 0;
	for(int i=0;i<N;i++){
		cin>>A[i];
		s += A[i];
		t += A[i]*A[i];
	}
	cout<<(s*s-t)/2<<endl;
}
0