- 博客(32)
- 收藏
- 关注
原创 11月26日训练
A.Make Even题意:Polycarp有一个整数????不包含数字0的。他可以使用他的数字执行以下操作数次(可能为零):颠倒长度前缀????换句话说,???? 最左边的数字)????. 因此,最左边的数字与????-左起第个数字,左起第二个数字与(????−1) -左th等,例如,如果????=123456789和????=5的新值???? 将是543216789.请注意,对于不同的操作????可能会有所不同。号码???? 可以等于数字的长度???? —在本例中,整数????相反。Polyca
2021-11-27 21:19:35 212
原创 11月23日题解
J - Justifying the Conjecture题意:伟大的数学家DreamGrid提出了一个猜想,认为:每个正整数都可以表示为一个素数和一个复合数的和。DreamGrid无法证明他的猜测是正确的,所以我们邀请您编写一个程序来验证它。给定一个正整数????, 求素数???? 和一个复合数???? 以致????+????=????.素数是大于1的自然数,不能由两个较小的自然数相乘而形成。大于1的非素数称为复合数。请注意,1既不是质数也不是复合数。题解:1.对于小于5等于5的整数,显然无
2021-11-25 15:51:09 181
原创 11月22日训练题解
题目链接:https://atcoder.jp/contests/abc228/tasksabc228_a题意:高桥每天在S点(24小时制)打开他的房间的灯,并在T点关闭。灯亮时日期可能会改变。确定灯是否在X点后30分钟亮起。题解:按题目叙述模拟即可 (说句实话细节比较多 直接看代码吧)#include <iostream>#include <algorithm>#include <cstdio>#include <cstring>#inclu
2021-11-23 17:21:54 444
原创 10.10本周训练
10.10周总结文章目录10.10周总结cfacwingatcodercfB. Hemose Shoppingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputHemose was shopping with his friends Samez, AhmedZ, AshrafEzz, TheSawan and O_E in Germa
2021-10-10 22:56:42 187
原创 本周训练总结
本周总结1.扩展GCD的学习参考:青蛙的约会2.复习筛素数相关题目Sum of Consecutive Prime Numbers链接:https://ac.nowcoder.com/acm/problem/107336来源:牛客网题目描述Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does
2021-10-03 18:56:53 90
原创 青蛙的约会
青蛙的约会青蛙的约会Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 123666 Accepted: 26384Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对
2021-09-29 21:50:55 108
原创 暑假训练四阶段day3
Cow AcrobatsFarmer John's N (1 <= N <= 50,000) cows (numbered 1..N) are planning to run away and join the circus. Their hoofed feet prevent them from tightrope walking and swinging from the trapeze (and their last attempt at firing a cow out of a ca
2021-08-31 21:05:55 137
原创 暑假训练四阶段day2
DryingIt is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring process. Jane has decided to use a radiator to make drying faster. But the radiator is small, so it can hold only one th
2021-08-31 20:49:33 128
原创 暑假训练四阶段day1
HamburgersPolycarpus loves hamburgers very much. He especially adores the hamburgers he makes with his own hands. Polycarpus thinks that there are only three decent ingredients to make hamburgers from: a bread, sausage and cheese. He writes down the recip
2021-08-31 20:33:12 167
原创 暑假训练三阶段day3
敌兵布阵 C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。中央情报局要研究敌人究竟演习什么战术,所以Tidy要随时向Derek汇报某一段连续的工兵营地一共有多少人,例如Derek问:“Tidy,马上汇
2021-08-31 20:11:23 110
原创 暑假训练三阶段day2
Jessica’s Reading ProblemJessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she wants to pass it, she has to master all ideas included in a very thick text book
2021-08-31 19:50:20 111
原创 暑假训练三阶段day1
Similar StringsPutting two similar strings together will create a very strong power that can quake the earth into parts and the person who did that can be called the Destroyer of the World. In order to stop the Destroyer of the World, WNJXYK decided to ch
2021-08-31 16:20:45 177
原创 暑假训练二阶段day3
Shuffle’m UpA common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stack containing C chips. Each stack may contain chips of several diffe
2021-08-31 16:06:31 207
原创 暑假训练二阶段day2
Lake CountingDue to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contains either water ('W') or dry land ('.'). Farmer
2021-08-31 15:35:16 151
原创 暑假训练二阶段day1
Breadth First SearchWrite a program which reads an directed graph G=(V,E)G = (V, E)G=(V,E), and finds the shortest distance from vertex 111 to each vertex (the number of edges in the shortest path). Vertices are identified by IDs 1,2,...n1, 2, ... n1,2,..
2021-08-31 15:23:10 178
原创 暑假训练day3
Bombing It’s a cruel war which killed millions of people and ruined series of cities. In order to stop it, let’s bomb the opponent’s base.It seems not to be a hard work in circumstances of street battles, however, you’ll be encountered a much more diffic
2021-08-31 14:44:26 144
原创 暑假训练day2
The Balance of the WorldThe world should be finely balanced. Positive vs. negative, light vs. shadow, and left vs. right brackets. Your mission is to write a program that judges whether a string is balanced with respect to brackets so that we can observe
2021-08-30 23:58:48 519
原创 暑假训练day1
StackReverse Polish notation is a notation where every operator follows all of its operands. For example, an expression (1+2)*(5+4) in the conventional Polish notation can be represented as 1 2 + 5 4 + * in the Reverse Polish notation. One of advantages o
2021-08-30 23:36:59 171
原创 度度熊学队列
度度熊正在学习双端队列,他对其翻转和合并产生了很大的兴趣。初始时有 N 个空的双端队列(编号为 1 到 N ),你要支持度度熊的 Q 次操作。①1 u w val 在编号为 u 的队列里加入一个权值为 val 的元素。(w=0 表示加在最前面,w=1 表示加在最后面)。②2 u w 询问编号为 u 的队列里的某个元素并删除它。( w=0 表示询问并操作最前面的元素,w=1 表示最后面)③3 u v w 把编号为 v 的队列“接在”编号为 u 的队列的最后面。w=0 表示顺序接(队列 v 的开头和队列
2021-08-05 22:25:34 92
原创 Buy and Resell
Buy and ResellThe Power Cube is used as a stash of Exotic Power. There are n cities numbered 1,2,…,n where allowed to trade it. The trading price of the Power Cube in the i-th city is ai dollars per cube. Noswal is a foxy businessman and wants to quietly
2021-08-05 22:23:31 71
原创 Potions (Hard Version)
Potions (Hard Version)This is the hard version of the problem. The only difference is that in this version n≤200000. You can make hacks only if both versions of the problem are solved.There are npotions in a line, with potion 1 on the far left and poti
2021-08-05 22:19:34 372
原创 Equal Sums
Equal SumsYou are given k sequences of integers. The length of the i-th sequence equals to ni.You have to choose exactly two sequences iand j (i≠j) such that you can remove exactly one element in each of them in such a way that the sum of the changed s
2021-08-05 22:13:36 131
原创 Shaolin
ShaolinShaolin temple is very famous for its Kongfu monks.A lot of young men go to Shaolin temple every year, trying to be a monk there. The master of Shaolin evaluates a young man mainly by his talent on understanding the Buddism scripture, but fighting
2021-08-05 20:54:01 158
原创 Queue
QueueThere are n processes in a queue. Each process has namei and timei. The round-robin scheduling handles the processes in order. A round-robin scheduler gives each process a quantum (a time slot) and interrupts the process if it is not completed by the
2021-08-05 20:47:25 48
原创 Stack
StackReverse Polish notation is a notation where every operator follows all of its operands. For example, an expression (1+2)*(5+4) in the conventional Polish notation can be represented as 1 2 + 5 4 + * in the Reverse Polish notation. One of advantages o
2021-08-05 20:43:19 40
原创 codeforces 1519 B. The Cake Is a Lie
本题我的方法是把每一个点都在之前全部求出来(因为每一个点都是唯一值)得到一个对称矩阵形式的二维数组 所以只需要对其预处理一下行和列的初始然后计算上一行加上对于这一行的位置就可以了(我队友找出来个规律(大腿还是大腿) 每个点都是(ij-1)的花费 只要计算(nm-1)是否等于k即可这是我的代码#include <iostream>using namespace std;long long cost[110][110];int main() { int t; cin.
2021-04-30 20:29:40 190 1
原创 codeforces B - Morning Jogging
模拟首先找到最小的前j个数寻找他在二维数组中的行数(注意每个数只能动一次(血的教训!!!!!!!!!!!!!!!!!!))#include<iostream>#include<algorithm>#include<string.h>using namespace std;const int maxn = 1e4+10;int a[maxn];int b[101][101];int c[101][101];bool cmp2(int a, int b
2021-04-25 20:25:32 502 1
原创 codeforces 1509 B. TMT Document
贪心求出在整个字符串中判断是否满足(当前T的数量 < 0或者 (T的总数 / 2) < 当前T的数量)如果不满足上述状态则输出“NO”其他就是“YES”#include<iostream>using namespace std;int main(void){ int t; cin >> t; while(t--) { int n; cin >> n; string
2021-04-19 19:22:11 244
原创 codeforces 1513 A. Array and Peaks
思维题判断峰的个数是否要大于(x+1)/2大于输出负一小于输出隔两位调换峰值次数代码如下#include<iostream>using namespace std;const int maxn = 100+10;int main(void){ int n; cin >> n; while(n--) { int a[maxn]; int x; cin >> x;
2021-04-18 19:25:41 180
原创 69A - Young Physicist
水题三个方向向量分别相加得零即可#include<iostream>using namespace std;const int maxn = 1e6+10;int a[maxn];int main(void){ int t; cin >> t; int cnt = 0; int x = 0,y = 0,z = 0; while(t--) { int a,b,c; cin >> a
2021-04-12 20:29:38 230
原创 58A - Chat room
水题对于hello每个字符顺序找即可(需要注意中间两个l的判断即可)#include<iostream>using namespace std;const int maxn = 1e6+10;int a[maxn];int main(void){ string s; cin >> s; int len = s.length(); int flag = 0; int flag1 = 0; int flag2 = 0;
2021-04-12 20:27:22 82
原创 codeforces 1510K——King‘s Task
codeforces 1510K——King’s Task无脑暴力主要思想:对于题目所给的排序方法 执行2n次后必定回到原形(可以自己试)所以就找到两个方法都进行来一次输出 然后找两种方法相比比较少的次数就可以了#include<iostream>#include<algorithm>using namespace std;const int maxn = 1e6+10;int a[maxn];int b[maxn];int c[maxn];using na
2021-04-09 20:21:08 328
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人