結果
| 問題 | No.1687 What the Heck? |
| コンテスト | |
| ユーザー |
ぷら
|
| 提出日時 | 2021-09-24 21:24:30 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 309 bytes |
| 記録 | |
| コンパイル時間 | 1,231 ms |
| コンパイル使用メモリ | 210,680 KB |
| 実行使用メモリ | 7,968 KB |
| 最終ジャッジ日時 | 2026-06-23 05:58:14 |
| 合計ジャッジ時間 | 2,422 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int>P(N);
long long sum = 0;
for(int i = 0; i < N; i++) {
cin >> P[i];
sum += i+1;
if(P[i] == N) {
sum -= 2LL*(i+1);
}
}
cout << max(0LL,sum) << endl;
}
ぷら