結果

問題 No.1687 What the Heck?
ユーザー baitoniochita
提出日時 2021-09-24 21:56:50
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,016 bytes
コンパイル時間 3,029 ms
コンパイル使用メモリ 229,932 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-05 10:31:50
合計ジャッジ時間 4,128 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 WA * 10
権限があれば一括ダウンロードができます

ソースコード

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