結果
問題 |
No.921 ずんだアロー
|
ユーザー |
![]() |
提出日時 | 2019-11-12 04:53:02 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,943 bytes |
コンパイル時間 | 1,499 ms |
コンパイル使用メモリ | 169,320 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-16 08:57:06 |
合計ジャッジ時間 | 2,977 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 7 WA * 15 |
ソースコード
#include "bits/stdc++.h" using namespace std; using ll = long long; using Graph = vector<vector<int>>; #define int ll #define double long double void YN(bool flg){cout<<(flg?"YES":"NO")<<endl;} void Yn(bool flg){cout<<(flg?"Yes":"No")<<endl;} void yn(bool flg){cout<<(flg?"yes":"no")<<endl;} #define SORT(a) sort(a.begin(),a.end()) #define REVERSE(a) reverse(a.begin(),a.end()) #define REP(i, n) for(int i = 0;i < n;i++) #define FOR(i, m, n) for(int i = m;i < n;i++) #define db(n) cout << "### " << n << " ###" << endl; typedef vector<int> VI; typedef vector<VI> VVI; const int MOD = 1000000007; const long long INF = 10e10; const double PI = acos(-1.0); 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; } template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); } template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); } template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); } template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); } template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); } int GCD(int a, int b) { return b ? GCD(b, a%b) : a; } int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; } int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n /= 2; }return r; } //------------------------------------------------------------------------------------------------------ signed main(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15); int n; cin >> n; VI a(n); REP(i,n) cin >> a[i]; int count = 0; REP(i,n){ if(a[i-1]!=a[i]){count++; i++;} } cout << n-count << endl; return 0; }