# Codeforces Round #412 (rated Archive

## Codeforces Round #412 (rated, Div. 1, based on VK Cup 2017 Round 3), problem: (F) Test Data Generation, Accepted Solution In C/C++

#include<bits/stdc++.h> #define ll long long ll multmod(ll a, ll b, ll moder){ a = (a % moder + moder) % moder, b = (b % moder + moder) % moder; ll ret = 0; for …

## Codeforces Round #412 (rated, Div. 1, based on VK Cup 2017 Round 3), problem: (E) Blog Post Rating Solution In JAVA

import static java.lang.Double.parseDouble; import static java.lang.Integer.parseInt; import static java.lang.Long.parseLong; import static java.lang.Math.min; import static java.lang.System.exit; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.Random; import java.util.StringTokenizer; public class E { static BufferedReader …

## 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 { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); PrintWriter printer = …

## 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; …

## 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 == -1 || a == -1 || a<a) sum = cnt; …

## Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3), problem: (B) T-Shirt Hunt Solution In C/C++

#include <bits/stdc++.h> using namespace std; int p,x,y,i; int luc(int s){ s = (s/50)%475; for (int i=0;i<25;i++) if((s=(s*96+42)%475)+26==p)return 1; return 0; } int main(){ cin>>p>>x>>y; for(i=x%50;!luc(i)||i<y;i+=50){} return cout<<(i<=x?0:(i-x+99)/100),0; }

## Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3), problem: (A) Is it rated? Solution In C/C++

#include <iostream> using namespace std; int n,i,a,a1,b,f; string s={“maybe”,”unrated”,”rated”}; int main(){ cin>>n; for(;i<n;i++){ cin>>a>>b; if(a!=b){f=2;break;} if(i>0&&a>a1)f=1; a1=a; } cout<<s; }