Codeforces Round #410 (Div. 2), problem: (C) Mike and gcd problem Solution In C/C++

By |2017-07-24T01:47:22+00:00July 24th, 2017|Categories: C/C++, Programming|Tags: , , |

#include <bits/stdc++.h> using namespace std; int main(){ int n, num = 0, x, sum = 0; scanf("%d", &n); int g=0; for(int i = 0; i < n; ++i){ scanf("%d", &x); g=__gcd(g,x); if(x&1){ num ++; }else{ sum = sum + num/2 + (num%2)*2; num = [...]