|
|
back to boardhere is my solution I've got AC 0,015 209kb #include <iostream> using namespace std; int main() { int n,a[1024],br=1,i; cin>>n; cin>>a[1]; if(n==1) { cout<<"1 "<<a[1]; } for(i=2;i<=n;i++) { cin>>a[i]; if(a[i]==a[i-1]) { br++; } if(a[i]!=a[i-1]) { cout<<br<<" "<<a[i-1]<<" "; br=1; } if(i==n) { cout<<br<<" "<<a[i]; } } cout<<endl; return 0; } Edited by author 07.04.2009 21:12 |
|
|