Sponsors

2025 MAC Football Week...

MAC Triumph: Miami RedHawks Silence Ball State 45-24 in...

KuCoin Strengthens Australian Presence...

KuCoin Strengthens Australian Presence with Major PGA Championship Partnership The...

The future is electrified....

The Electrified Future is Here: AI Energy Demand Outpaces...

Arc Raiders Is Discounted...

Huge Discount: Arc Raiders Drops Price on PC Ahead...

Louisiana’s top health official,...

Controversial Figure Dr. Ralph Abraham Tapped for CDC Deputy...

Consumer Bureau’s Bank Examiners...

The ‘Humility Pledge’ Backfires: Consumer Bureau Examiners Blast New...

Bioengineering a reversal of...

The Dawn of Donor-Free Vision: Pandorum's 'Liquid Cornea' Breakthrough Corneal...

Florida Man Takes His...

The Bizarre Case of Alan Abrahamson: Suicide by Weather...

One Piece: Pirate Warriors...

One Piece: Pirate Warriors 4 Sails onto PS5 and...

Blue Origin Will Increase...

Blue Origin Supercharges New Glenn Rocket with Major Thrust...

CNBC Daily Open: Nvidia...

Nvidia CEO Jensen Huang Dismisses AI 'Bubble' Fears Amid...

How Xiaomi’s AI Efforts...

Xiaomi’s AI Leap: Powering the Next Era of the...

Advertisement

Codeforces Round #420 (Div. 2), problem: (E) Okabe and El Psy Kongroo Solution In C/C++

#include <stdio.h> #define m 1000000007u typedef long long unsigned llu; typedef unsigned u; u M; u X,Y,*A,*B,*C; int...

Codeforces Round #420 (Div. 2), problem: (D) Okabe and City Solution In C/C++

#include<iostream> #include<cstdio> #include<cstring> #include<queue> #include<cmath> using namespace std; const int maxn=1e4+5; const int inf=0x7f7f7f7f; int x,y,dis; bool vis; int k,n,m; int bfs() { queue<int>q; q.push(1); //memset //for(int i=1;i<=n;i++)dis=inf; memset(dis,0x7f,sizeof...

Codeforces Round #420 (Div. 2), problem: (C) Okabe and Boxes Solution In C/C++

#include <cstdio> using namespace std; int n,s,top; int main() { int i,j,ans=0; char op; scanf("%d",&n); for(i=j=1;i<=2*n;++i) { scanf("%s",op); if(op=='a') scanf("%d",&s); else { if(top) { if(s==j) --top; else top=0,++ans; } ++ j; } } printf("%dn",ans); }

Codeforces Round #420 (Div. 2), problem: (B) Okabe and Banana Trees Solution In C/C++

#include <iostream> using namespace std; int main(){ long long int m,b,s=0,x; cin>>m>>b; for(int i=0;i<=b;i++){ x=(b-i)*m; s=max(s,((i+1)*(x+1)*(i+x))/2); } cout<<s; }

Codeforces Round #420 (Div. 2), problem: (A) Okabe and Future Gadget Laboratory Solution In C/C++

#include <bits/stdc++.h> using namespace std; int main() { int n,a,i,j,k,l,f; cin>>n; for(i=0;i<n;i++) for(j=0;j<n;j++) cin>>a; for(i=0;i<n;i++) for(j=0;j<n;j++) { f=0; for(k=0;k<n;k++) for(l=0;l<n;l++) if(a==a+a||a==1) f=1; if(!f) { cout<<"Non"; return 0; } } cout<<"Yesn"; return 0; }

Codeforces Round #421 (Div. 1), problem: (E) Mister B and Flight to the Moon Solution In C/C++

#include<cstdlib> #include<cstdio> #include<algorithm> using namespace std; const int N=301; const int M=100001; const int K=4; int a; int f; int n,m,i,j,k,x,y,t,u,v; void...

Codeforces Round #421 (Div. 1), problem: (D) Mister B and Astronomers Solution In C/C++

#include <bits/stdc++.h> #define ll long long using namespace std; ll n,t,k,i,m,q,f; ll a,s,w,p,res; map <int,int> mapp; ll cal(ll...

Codeforces Round #421 (Div. 2), problem: (E) Mister B and Beacons on Field Solution In C/C++

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; import java.util.TreeMap; /** * @author Don Li */ public...

Codeforces Round #421 (Div. 2), problem: (D) Mister B and PR Shifts Solution In C/C++

#include<stdio.h> #include<stdlib.h> #define LL long long int p, cur; int main(void) { LL ans, sum; int n, L, r,...

Codeforces Round #421 (Div. 2), problem: (C) Mister B and Boring Game Solution In JAVA

import java.util.Scanner; public class C { public static void main(String args) { // TODO Auto-generated...

Codeforces Round #421 (Div. 2), problem: (B) Mister B and Angle in Polygon Solution In C/C++

#include <iostream> using namespace std; int main(){ int n,m,q; cin>>n>>m; q=(n*m+90)/180+2; if(q<n){ n=q; } if(n<3){ n=3; } cout<<"2 1 "<<n; return 0; }

Codeforces Round #421 (Div. 2), problem: (A) Mister B and Book Reading Solution In C/C++

#include <iostream> using namespace std; int c,v,vl,l,a; int main(){ cin>>c>>v>>vl>>a>>l; int s=1; for(int i=v;i<c;){ v+=a; if(v>vl) v=vl; i-=l; i+=v; s++;} cout<<s<<endl; }

The future is electrified....

The Electrified Future is Here: AI Energy Demand Outpaces...

Arc Raiders Is Discounted...

Huge Discount: Arc Raiders Drops Price on PC Ahead...

Louisiana’s top health official,...

Controversial Figure Dr. Ralph Abraham Tapped for CDC Deputy...

Consumer Bureau’s Bank Examiners...

The ‘Humility Pledge’ Backfires: Consumer Bureau Examiners Blast New...

Bioengineering a reversal of...

The Dawn of Donor-Free Vision: Pandorum's 'Liquid Cornea' Breakthrough Corneal...

Florida Man Takes His...

The Bizarre Case of Alan Abrahamson: Suicide by Weather...

One Piece: Pirate Warriors...

One Piece: Pirate Warriors 4 Sails onto PS5 and...

Blue Origin Will Increase...

Blue Origin Supercharges New Glenn Rocket with Major Thrust...

CNBC Daily Open: Nvidia...

Nvidia CEO Jensen Huang Dismisses AI 'Bubble' Fears Amid...

How Xiaomi’s AI Efforts...

Xiaomi’s AI Leap: Powering the Next Era of the...

When Gratitude Is Weaponized:...

The Dark Side of Thankfulness: Understanding Weaponized Gratitude Gratitude is...

The Road Wraps Up...

"The Road" Hits a Major Milestone: Wrapping Up the...