結果
| 問題 |
No.1447 Greedy MtSaka
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-08-12 15:58:58 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 285 bytes |
| コンパイル時間 | 845 ms |
| コンパイル使用メモリ | 71,776 KB |
| 最終ジャッジ日時 | 2025-01-23 17:45:27 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main(void){
int N,ans=0;
cin >> N;
vector<int> X(N),Y(N);
for(int i=0;i<N;i++)cin >> X[i] >> Y[i];
for(int i=0;i<N;i++){
ans+=(X[i]*Y[(i+1)%N]-X[(i+1)%N]*Y[i]);
}
cout << ans << endl;
}