結果
| 問題 |
No.1447 Greedy MtSaka
|
| コンテスト | |
| ユーザー |
🍮かんプリン
|
| 提出日時 | 2021-03-31 22:02:24 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 445 bytes |
| コンパイル時間 | 1,367 ms |
| コンパイル使用メモリ | 167,628 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-15 18:43:21 |
| 合計ジャッジ時間 | 2,129 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
/**
* @FileName a.cpp
* @Author kanpurin
* @Created 2021.03.31 22:02:19
**/
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int main() {
int n;cin >> n;
ll ans = 0;
ll x1,y1,x2,y2;cin >> x1 >> y1 >> x2 >> y2;
for (int i = 2; i < n; i++) {
ll x,y;cin >> x >> y;
ans += abs((x1-x)*(y2-y)-(x2-x)*(y1-y));
x2 = x;
y2 = y;
}
cout << ans << endl;
return 0;
}
🍮かんプリン