結果

問題 No.1285 ゴミ捨て
ユーザー kawara_y_kyoprokawara_y_kyopro
提出日時 2020-11-13 21:26:15
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,772 bytes
コンパイル時間 1,781 ms
コンパイル使用メモリ 124,668 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-30 02:32:31
合計ジャッジ時間 3,122 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
// #include <atcoder/all>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vii = V<int>;
using vvll = V<vll>;
using vvii = V< V<int> >;
using PII = P<int, int>;
using PLL = P<ll, ll>;
#define RevREP(i,n,a) for(ll i=n;i>a;i--)  // (a,n]
#define REP(i,a,n) for(ll i=a;i<n;i++)  // [a,n)
#define rep(i, n) REP(i,0,n)
#define ALL(v) v.begin(),v.end()
#define eb emplace_back
#define pb push_back
template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; }
template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; }
#define DEBUG_VLL(vec) for(int sz=0;sz<int(vec.size());sz++) std::cerr<<vec[sz]<<(sz==int(vec.size())-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vii a(n);
    rep(i, n) cin >> a[i];
    int a1 = -1, a2 = -1;
    rep(i, n) {
        if (a1 + 1 < a[i]) a1 = a[i];
        else a2 = a[i];
    }

    if (a2 != -1) cout << 2 << '\n';
    else cout << 1 << '\n';
    return 0;
}
0