結果
| 問題 | No.1874 Minimum of Sum of Rectangles |
| コンテスト | |
| ユーザー |
shiomusubi496
|
| 提出日時 | 2022-02-27 11:42:29 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 471 bytes |
| 記録 | |
| コンパイル時間 | 1,316 ms |
| コンパイル使用メモリ | 211,412 KB |
| 実行使用メモリ | 13,184 KB |
| 最終ジャッジ日時 | 2026-06-25 09:36:11 |
| 合計ジャッジ時間 | 7,483 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 5 TLE * 1 -- * 33 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int N; cin >> N;
vector<ll> X(N), Y(N);
for (int i=0; i<N; i++) cin >> X[i] >> Y[i];
ll ans = 1e18;
for (int i=0; i<N; i++) {
for (int j=0; j<N; j++) {
ll p = X[i], q = Y[j];
ll sum = 0;
for (int k=0; k<N; k++) sum += abs(X[k] - p) * abs(Y[k] - q);
ans = min(ans, sum);
}
}
cout << ans << endl;
}
shiomusubi496