AtCoder Beginner Contest 349
AtCoder Beginner Contest 349A思路因为是零和博弈,所以和是零,所以输出所有元素之和的负数即可
代码123456789101112131415161718192021222324252627#include<bits/stdc++.h>using namespace std;void solve(){ int n; cin >> n; int sum = 0; for(int i = 0; i < n - 1; i++){ int x; cin >> x; sum += x; } int ans = -sum; cout << ans;}int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); solve(); return 0;}
B思路先处理每一种字母出现几次,然后 ...
Codeforces Round 939 (Div. 2)
Codeforces Round 939 (Div. 2)A. Nene’s Game题目:Limit:time limit per test: 1 secondmemory limit per test: 256 megabytes
Describe:Nene invented a new game based on an increasing sequence of integers $a_1, a_2, \ldots, a_k$.In this game, initially $n$ players are lined up in a row. In each of the rounds of this game, the following happens: Nene finds the $a_1$-th, $a_2$-th, $\ldots$, $a_k$-th players in a row. They are kicked out of the game simultaneously. If the $i$-th player in a row should be k ...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment
Codeforces Round 829 (Div. 2)
Codeforces Round 829 (Div. 2)A. Technical Support题目:Limit:time limit per test: 1 secondmemory limit per test: 256 megabytes
Describe:You work in the quality control department of technical support for a large company. Your job is to make sure all client issues have been resolved.Today you need to check a copy of a dialog between a client and a technical support manager. According to the rules of work, each message of the client must be followed by one or several messages, which are the answer of ...
AtCoder Beginner Contest 348
AtCoder Beginner Contest 348A - Penalty Kick依照题意输出即可
1234567891011121314151617181920#include<bits/stdc++.h>using namespace std;void solve(){ int n; cin >> n; for(int i = 1; i <= n; i++){ cout << (i % 3 == 0? 'x': 'o'); }}int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); solve(); return 0;}
B - Farthest Point依照题意计算欧式距离即可
123456789101112131415161718192021222324252627282930313233#in ...
Codeforces Round 803 (Div. 2)
Codeforces Round 803 (Div. 2)A. XOR Mixup题目:Limit:time limit per test: 1 secondmemory limit per test: 256 megabytes
Describe:There is an array $a$ with $n-1$ integers. Let $x$ be the bitwise XOR of all elements of the array. The number $x$ is added to the end of the array $a$ (now it has length $n$), and then the elements are shuffled.You are given the newly formed array $a$. What is $x$? If there are multiple possible values of $x$, you can output any of them.
Input:The input consists of multi ...
FFT/NTT字符串模糊匹配
原文链接
2024 团体程序设计天梯赛 · 校内选拔赛
线段树存multiset题意描述
你通过了蓝鸟的考验,成为了DHUACM的中枢。
现在,你需要为队员们制定一个评分表,以监督队员们的训练状况。
具体来说,有 n 名队员,第 i 名队员的评分是 a**i 。
接下来,你需要按顺序执行 q 次操作,有以下两种:
1 x val 表示将第 x 名队员的评分改为 val 。
2 l r val 输出区间 [l,r] 的队员的评分中小于等于 val 的最大评分开除警告,若不存在输出 −1。
输入描述
第一行,包含两个整数, n,q (1≤n,q≤2×105)。
第二行,包含 n 个整数,第 i 个整数为 a**i (1≤a**i≤109)。
接下来 q 行,每行第一个整数表示操作类型:
若是第一种操作,则接下来包含两个整数 x,val (1≤x≤n,1≤val≤109)。
若是第二种操作,则接下来包含三个整数 l,r,val (1≤l≤r≤n,1≤val≤109)。
输出描述
对于每一次第二种操作,输出一行,包含一个整数,表示答案。
用例输入 1
12345610 41 2 3 4 5 6 7 8 9 101 6 52 1 10 52 ...