Tag: based on VK Cup 2017 Round 2)

Codeforces Round #409 (rated, Div. 1, based on VK Cup 2017 Round 2), problem: (E) Verifying Kingdom Solution In C/C++

#include<cstdio> #include<cstring> #include<algorithm> #include<cctype> #include<ctime> #include<cstdlib> #include<string> #include<queue> #include<cmath> #include<set> #include<map> #include<bitset> #include<vector> #define rep(x,a,b) for (int x=int(a);x<=(int)(b);x++) #define drp(x,a,b) for (int x=int(a);x>=(int)(b);x--) #define cross(x,a) for (int x=hd;~x;x=nx) #define ll long long #define inf...

Codeforces Round #409 (rated, Div. 1, based on VK Cup 2017 Round 2), problem: (D) Varying Kibibits Solution In C/C++

#include <bits/stdc++.h> #define MAXN (1000000) #define MAXM (6) #define mod (1000000007) #define ll long long int n; int a, b, c, g, pow10; void...

Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2), problem: (E) Vulnerable Kerbals Solution in JAVA

import java.util.ArrayList; import java.util.Scanner; /* 4 10 2 4 6 8 4 10 2 9 1 0 */ public class e { static ArrayList<Integer> gcdLists; public static...

Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2), problem: (D) Volatile Kite Solution In C/C++

#include<cstdio> #include<cstdlib> #include<cmath> #include<algorithm> #include<cstring> using namespace std; #define maxn 1005 int x,y; int n; long long area(int i) { int j=(i-1+n)%n,k=(i+1)%n; long long x1=x-x,y1=y-y, x2=x-x,y2=y-y; return abs(x1*y2-x2*y1); } double length(int i) { int j=(i-1+n)%n,k=(i+1)%n; long...

Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2), problem: (C) Voltage Keepsake Solution In C/C++

#include <bits/stdc++.h> using namespace std; struct Time { int i; double v; }; const int MAXN = 1e5; int a, b; Time t; int main() { int...

Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2), problem: (B) Valued Keys Solution In C/C++

#include<bits/stdc++.h> using namespace std; int main() { string a,b; cin>>a>>b; int l=a.length(); for(int i=0;i<l;i++) { if(a<b) { ...

Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2), problem: (A) Vicious Keyboard Solution In C/C++

#include <stdio.h> int ans,l,i; int main() { char ch; scanf("%s",ch); for( ; ch; i++) { l++; if(ch=='V' && ch=='K') ans++,ch='#',ch='#',i++; } l++; for(i=0; ch; i++) { if((ch=='V' && ch=='V') || (ch=='K'&&ch=='K')) { ans++; break; } } printf("%d",ans); }

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!