結果

問題 No.921 ずんだアロー
ユーザー sashimingsashiming
提出日時 2019-11-17 00:49:31
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 1,567 bytes
コンパイル時間 2,254 ms
コンパイル使用メモリ 200,484 KB
実行使用メモリ 4,360 KB
最終ジャッジ日時 2023-10-25 10:44:56
合計ジャッジ時間 3,329 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(int i=0;i<(n);++i)
#define RANGE(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(n)-1;i>= 0;--i)

#define endl '\n'
#define pb push_back
#define eb emplace_back
#define pque priority_queue
#define umap unordered_map
#define uset unordered_set
#define BIG 2000000000
#define VERYBIG 1000000000000000ll
#define PI 3.141592653589793238
#define dcout cout<<fixed<<setprecision(20)

const long long dx[]={1,0,-1,0,1,1,-1,-1}, dy[]={0,-1,0,1,1,-1,1,-1};
const long long MOD = 1e9+7;

// typedef long long ll;
#define int long long
#define double long double

template<typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template<typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template<typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}

typedef pair<int, int> INTP;
typedef vector<int> INTV;
struct edge2 {int to, cost;};
struct edge3 {int from, to, cost;};

signed main(void){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N, A[100000]; cin >> N;
  REP(i, N) cin >> A[i];
  int cnt = 0;
  REP(i, N){
    cnt++;
    if(i < N-1){
      if(A[i] != A[i+1]) i++;
    }
  }
  cout << cnt << endl;
}
0