We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 547021b commit abb2c05Copy full SHA for abb2c05
344A - Magnets.cpp
@@ -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
20
21
+ if(mag[i]!=mag[i+1])
22
+ gp++;
23
24
+ cout<<gp<<endl;
25
+ return 0;
26
+}
0 commit comments