Codeforces Round #390 (Div. 2), problem: (E) Dasha and Cyclic Table Solution in C/C++

By | 2017-04-07T22:11:45+00:00 January 6th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

Codeforces Round #390 (Div. 2), problem: (E) Dasha and Cyclic Table Solution in C/C++       #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int N = 401; bitset<N> rc[N][N][26]; string s[N]; string [...]

Codeforces Round #390 (Div. 2), problem: (D) Fedor and Coupons Solution in C/C++

By | 2017-04-07T22:11:45+00:00 January 6th, 2017|Categories: C/C++, Programming|Tags: , , , , , , |

Codeforces Round #390 (Div. 2), problem: (D) Fedor and Coupons Solution in C/C++     #include <bits/stdc++.h> #include <iostream> #include <queue> #include <set> using namespace std; #define mp make_pair #define fi first #define se second typedef long long ll; ll n,k,ans,l; priority_queue<ll>s; struct item [...]

Codeforces Round #390 (Div. 2), problem: (C) Vladik and Chat Solution in C/C++

By | 2017-04-07T22:11:45+00:00 January 6th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

Codeforces Round #390 (Div. 2), problem: (C) Vladik and Chat Solution in C/C++ #include <stdio.h> #include <string.h> int main() { int t; scanf("%d", &t); while(t--) { int n, m; scanf("%d", &n); char Name[100][11]; for(int i = 0; i < n; ++i) { scanf("%s", Name[i]); [...]

Codeforces Round #390 (Div. 2), problem: (B) Ilya and tic-tac-toe game Solution in C/C++

By | 2017-04-07T22:11:45+00:00 January 6th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

Codeforces Round #390 (Div. 2), problem: (B) Ilya and tic-tac-toe game Solution in C/C++   #include<stdio.h> #include<stdlib.h> typedef unsigned u; char S[4][4];u x,o; void chk(u r,u c,u dr,u dc,u s,u l) { if(!(dr|dc))dr=-(dc=1); if(r>3||c>3){x=o=0;return;} if(l)x=o=0; if(S[r][c]=='x')++x; if(S[r][c]=='o')++o; if(s)chk(r+dr,c+dc,dr,dc,s-1,0); return; } int main() { u [...]

Codeforces Round #390 (Div. 2), problem: (A) Lesha and array splitting Solution in C/C++

By | 2017-04-07T22:11:45+00:00 January 6th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

Codeforces Round #390 (Div. 2), problem: (A) Lesha and array splitting Solution in C/C++   #include<stdio.h> #include<stdlib.h> typedef unsigned u; u A[111]; int main() { u n,i=-1,j=0; for(scanf("%u",&n);++i<n;j+=A[i])scanf("%u",A+i); if(j){printf("YES\n1\n1 %u\n",n);return 0;} for(i=-1;++i<n&&!A[i];); printf(i!=n?"YES\n2\n1 %u\n%u %u\n":"NO\n",i+1,i+2,n); return 0; }