Tag: Div. 2

Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3), problem: (F) Perishable Roads Solution In JAVA

import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.StringTokenizer; public class Div2_412F { public static void main(String args) throws IOException...

Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3), problem: (E) Prairie Partition Solution In C/C++

#include<bits/stdc++.h> using namespace std; int n; long long a; int check(int x){ int i,j,res,ress,t,sum; long long A,AA; i=0;ress=0; for(j=0;j<60;j++){ A=(1LL<<j); res=0; for(;i<n;i++){ if(a==A){ res++; } else if(a<A){ ress++; } else break; } if(ress>x) return 0; if(x>res){ ress-=(x-res); if(ress<0) ress=0; x=res; } if(res>x) ress+=(res-x); } return...

Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3), problem: (D) Dynamic Problem Scoring Solution In C/C++

#include<bits/stdc++.h> using namespace std; int a; int cnt; int n; int getsc(int id, bool f, int s) { if(a==-1) return 0; int sum; if(a ==...

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!