Tag: Codeforces Round #385 (Div. 2)

Codeforces Round #385 (Div. 2), problem: (E) Hongcow Buys a Deck of Cards Solution in C/C++

#include<bits/stdc++.h> using namespace std; const int maxn=16,INF=0x3f3f3f3f; char type; int R,B; char readchar() { for(;;) { char ch=getchar(); if(!isspace(ch)) { return ch; } } } int n; typedef pair<int,int> pii; typedef set<pii>...

Codeforces Round #385 (Div. 2), problem: (D) Hongcow’s Game Solution in C/C++

#include <limits.h> #include <stdio.h> #define N 1000 void query(int *ww, int *aa, int k, int n) { int i; printf("%dn", k); for (i =...

Codeforces Round #385 (Div. 2), problem: (C) Hongcow Builds A Nation Solution in C/C++

#include <stdio.h> #include <string.h> int c, p, sz, gov; int find_parent(int n) { if (p == n) ...

Codeforces Round #385 (Div. 2), problem: (B) Hongcow Solves A Puzzle Solution in C/C++

#include <limits.h> #include <stdio.h> int main() { int i, j, n, m, cnt, imin, jmin, imax, jmax; static char cc; scanf("%d%d", &n,...

Codeforces Round #385 (Div. 2), problem: (A) Hongcow Learns the Cyclic Shift Solution in C/C++

#include<stdio.h> #include<string.h> void cycle(char s,int len) { char temp=s; int i; for(i=len-1;i>0;i--) { s=s; } s=temp; } int main(){ char s,orig; int len,count=0; scanf("%s",s); len=strlen(s); strcpy(orig,s); do { cycle(s,len); count++; } while(strcmp(orig,s)); printf("%dn",count); return 0; }

Want to stay up to date with the latest news?

We would love to hear from you! Please fill in your details and we will stay in touch. It's that simple!