传送门 A. 2048 Game 乱搞即可. Code #include <bits/stdc++.h> #define MP make_pair #define fi first #define se second #define sz(x) (int)(x).size() //#define Local using namespace std; typedef long long ll; typedef pair<int, int> pii; const int N = 1e5…
链接: https://codeforces.com/contest/1221/problem/D 题意: You have a fence consisting of n vertical boards. The width of each board is 1. The height of the i-th board is ai. You think that the fence is great if there is no pair of adjacent boards having…
链接: https://codeforces.com/contest/1221/problem/B 题意: You are given a chess board with n rows and n columns. Initially all cells of the board are empty, and you have to put a white or a black knight into each cell of the board. A knight is a chess pi…
链接: https://codeforces.com/contest/1221/problem/C 题意: You may have already known that a standard ICPC team consists of exactly three members. The perfect team however has more restrictions. A student can have some specialization: coder or mathematici…
链接: https://codeforces.com/contest/1221/problem/A 题意: You are playing a variation of game 2048. Initially you have a multiset s of n integers. Every integer in this multiset is a power of two. You may perform any number (possibly, zero) operations wi…
这道题里线段树用来区间更新(每次给更大的区间加上当前区间的权重),用log的复杂度加快了更新速度,也用了区间查询(查询当前区间向右直至最右中以当前区间端点向右一段区间的和中最大的那一段的和),也用log的复杂度加快了查询速度. #define HAVE_STRUCT_TIMESPEC #include<bits/stdc++.h> using namespace std; ],y[]; ]; ]; vector<pair<]; ],lz[],mxid[]; long long cm…
#define HAVE_STRUCT_TIMESPEC#include<bits/stdc++.h>using namespace std;long long a[300007],b[300007];long long dp[300007][5];long long ans;int main(){ ios::sync_with_stdio(false);//多组数据输入cin,cout容易超时 cin.tie(NULL); cout.tie(NULL); int q; cin>>…
C. Brutality time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are playing a new famous fighting game: Kortal Mombat XII. You have to perform a brutality on your opponent's character. You…
Problem Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec Problem Description Input Output The only line should contain the minimal number of days required for the ship to reach the point (x2,y2)(x2,y2). If it…