Celebrating Black History Month:...
As February unfolds, so does the annual celebration of...
The Path to Self-Mastery:...
Embarking on a journey of self-mastery and breaking free...
Wizards of Waverly Place...
In a spellbinding announcement, Disney has officially revealed that...
Coachella 2024: Iconic headliners,...
Coachella Valley Music and Arts Festival, one of the...
2024 Taiwan Election: Pivotal...
As Taiwan gears up for its 2024 presidential election,...
Michael Strahan’s Daughter’s Medulloblastoma...
In a recent and heartbreaking revelation, Michael Strahan, former...
Michigan vs. Washington: The...
In a highly anticipated matchup, the 2024 National Championship...
Jason Kelce: Unmasking the...
In the world of professional football, where conformity often...
A Comprehensive Analysis of...
Boeing, a global aerospace giant, has long been a...
Unlocking Full-Stack Mastery: Web...
In the rapidly evolving landscape of technology, the demand...
Advertisement
C/C++
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 =...
Java
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
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...
C/C++
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...
C/C++
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)...
C/C++
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...
C/C++
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;
}
C/C++
Codeforces Round #411 (Div. 1), problem: (F) Fake bullions Solution In JAVA
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
public class Div1_411F {
int numTV;
int...
C/C++
Codeforces Round #411 (Div. 1), problem: (E) The same permutation Solution In C/C++
#include <stdio.h>
int n;
int main()
{
scanf("%d",&n);
if(n%4>1)return printf("NOn"),0;
printf("YESn");
for(int i=1;i<n;i+=4)
{
if(n%4)printf("%d %dn%d %dn%d %dn",i+2,n,i+2,i+3,i+3,n);
else printf("%d %dn",i+2,i+3);
printf("%d %dn",i,i+2);
printf("%d...
C/C++
Codeforces Round #411 (Div. 2), problem: (F) Expected diameter of a tree Solution In C/C++
#include <set>
#include <vector>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int N=200050;
vector<int>vec,dis,sum;
struct Node{int x,y;double...
C/C++
Codeforces Round #411 (Div. 2), problem: (E) Ice cream coloring Solution In C/C++
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<set>
using namespace std;
const int MX=600111;
int n,m;
int pool,*c,s;
int hed,nxt,t,ec,vis,vism,no;
set<int>cur;
inline void ade(int u,int v){
ec++;nxt=hed;t=v;hed=ec;
}
void...
C/C++
Codeforces Round #411 (Div. 2), problem: (D) Minimum number of steps Solution In C/C++
#include<bits/stdc++.h>
using namespace std;
int c,d,i,n,m,k,x,j=1000000007;
string s;
main(){
cin>>s;
for(i=s.size()-1;i>=0;i--){
if(s=='b')c++;else{
k+=c;c*=2;k%=j;c%=j;
}
}
cout<<k;
}
Wizards of Waverly Place...
In a spellbinding announcement, Disney has officially revealed that...
Coachella 2024: Iconic headliners,...
Coachella Valley Music and Arts Festival, one of the...
2024 Taiwan Election: Pivotal...
As Taiwan gears up for its 2024 presidential election,...
Michael Strahan’s Daughter’s Medulloblastoma...
In a recent and heartbreaking revelation, Michael Strahan, former...
Michigan vs. Washington: The...
In a highly anticipated matchup, the 2024 National Championship...
Jason Kelce: Unmasking the...
In the world of professional football, where conformity often...
A Comprehensive Analysis of...
Boeing, a global aerospace giant, has long been a...
Unlocking Full-Stack Mastery: Web...
In the rapidly evolving landscape of technology, the demand...
Winter Skincare Essentials: Must-Have...
As winter sets in and the temperature drops, it's...
Morning Glow: DIY Beauty...
Unlocking the secret to radiant and glowing skin often...