# Codeforces Round #412 (rated

/Tag: Codeforces Round #412 (rated

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

By |2017-07-24T02:44:29+06:00July 24th, 2017|Categories: C/C++, Programming||

#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 ( ; b; b >>= 1){ if (b & [...]

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

By |2017-07-24T02:42:50+06:00July 24th, 2017|Categories: Java, Programming||

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 in; static PrintWriter out; static StringTokenizer tok; static int [...]

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

By |2017-07-24T02:40:45+06:00July 24th, 2017|Categories: Java, Programming||

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 = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); int numV = Integer.parseInt(reader.readLine()); long[][] [...]

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

By |2017-07-24T02:37:16+06:00July 24th, 2017|Categories: C/C++, Programming||

#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[i]==A){ res++; } else if(a[i]<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); } [...]

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

By |2017-07-24T02:35:23+06:00July 24th, 2017|Categories: C/C++, Programming||

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

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

By |2017-07-24T02:31:32+06:00July 24th, 2017|Categories: C/C++, Programming||

#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++

By |2017-07-24T02:30:01+06:00July 24th, 2017|Categories: C/C++, Programming||

#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[f]; }