結果
| 問題 | No.2284 Assembly |
| コンテスト | |
| ユーザー |
hongrock
|
| 提出日時 | 2023-04-28 21:48:44 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 16 ms / 2,000 ms |
| コード長 | 458 bytes |
| 記録 | |
| コンパイル時間 | 1,158 ms |
| コンパイル使用メモリ | 209,336 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-30 11:08:43 |
| 合計ジャッジ時間 | 2,351 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 2e5 + 10;
int a[N], b[N];
int main(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n;
cin >> n;
ll s1 = 0, s2 = 0;
for(int i=0; i<n; ++i){
cin >> a[i] >> b[i];
s1 += a[i];
s2 += b[i];
}
ll ans = 0;
for(int i=0; i<n; ++i){
s1 -= a[i];
s2 -= b[i];
ans += max(a[i] * s2, b[i] * s1);
}
cout << ans << '\n';
return 0;
}
hongrock