akane86's blog

By akane86, history, 4 years ago, In English

My code is correct and returns correct answer locally, but it gets wrong answer on Codeforces.


#include<bits/stdc++.h> using namespace std; int main(){ int g; vector<string> s; int grps; string l; cin >> g; while(g--){ cin >> l; s.push_back(l); } for(int i = 0; i < s.size()-1; i++){ if(s[i] != s[i+1]) grps++; } cout << grps++ << endl; }

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it