Skip to content

Commit abb2c05

Browse files
committed
Added 344A - Magnets.cpp
1 parent 547021b commit abb2c05

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

344A - Magnets.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define pb push_back
5+
6+
// Code Written By: Vikash Patel
7+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8+
9+
int main()
10+
{
11+
int n;
12+
cin>>n;
13+
string mag[n];
14+
for(int i = 0;i<n;i++)
15+
{
16+
cin>>mag[i];
17+
}
18+
int gp = 0;
19+
for(int i = 0;i<n;i++)
20+
{
21+
if(mag[i]!=mag[i+1])
22+
gp++;
23+
}
24+
cout<<gp<<endl;
25+
return 0;
26+
}

0 commit comments

Comments
 (0)