結果

問題 No.1687 What the Heck?
ユーザー baitoniochitabaitoniochita
提出日時 2021-09-24 21:56:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,016 bytes
コンパイル時間 4,639 ms
コンパイル使用メモリ 226,164 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-18 21:17:14
合計ジャッジ時間 5,056 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 20 ms
4,380 KB
testcase_10 AC 13 ms
4,376 KB
testcase_11 AC 14 ms
4,380 KB
testcase_12 AC 56 ms
4,376 KB
testcase_13 AC 56 ms
4,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ld = long double;
#define _GLIBCXX_DEBUG
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define overload4(_1, _2, _3, _4, name, ...) name
#define rep1(n) for(ll i = 0; i < (n); ++i)
#define rep2(i, n) for(ll i = 0; i < (n); ++i)
#define rep3(i, a, b) for(ll i = (a); i < (b); ++i)
#define rep4(i, a, b, c) for(ll i = (a); i < (b); i += (c))
#define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
#define vv(type,name,h,...) vector<vector<type>>name(h,vector<type>(__VA_ARGS__))
using ll = long long;
long long MOD=1000000007;
ll MOD2=998244353;
const ll INF=0x1fffffffffffffff;
using Graph = vector<vector<int>>;
template<class T> using pq = priority_queue<T, vector<T>, greater<T>>;
int main() {
   ll N;
   cin>>N;
  ll ans=0;
rep1(N){
  ll x;
  cin>>x;
  if(x==N) ans-=i+1;
  else ans+=i+1;
}
  ll p=0;
cout<<max(p,ans)<<endl;
}
                            


0