Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
57333 | 陈思雨 | 排队买票 | C++ | Accepted | 100 | 0 MS | 252 KB | 201 | 2022-08-05 12:37:59 |
#include<bits/stdc++.h> using namespace std; int n,res; string a[30]={"0"}; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]!=a[i-1]) res++; } cout<<res+1; return 0; }