思维题
想法
★漂浮ing☆
奋斗ing
展开
-
思维训练3
A排序,求出相邻元素的差,如果有大于一的就不行。#include <bits/stdc++.h>using namespace std;int a[100],b[100];int main(){ int t,n; cin>>t; while(t--) { int cnt=0,sum=0; cin>>n; for(int i=1;i<=n;i++)原创 2020-08-06 23:43:41 · 180 阅读 · 0 评论 -
开学第三周
从上个周周末网络赛打完,这一段时间还是在看自己分工的内容,就是在一段时间内看自己究竟能到什么水平,感觉训练室里的学长们都比较强,要努力;;从网络赛来看,和平时的比赛还是有区别的,自己的水平离着参加比赛拿牌还差点,修炼一段时间使自己达到一个感觉能够参加比赛的状态,Fighting!!...原创 2019-09-19 09:01:20 · 111 阅读 · 0 评论 -
思维入门2
A写出规律发现是(n+1)/2#include <bits/stdc++.h>using namespace std;int main(){ ios::sync_with_stdio(false); int n,t; cin>>t; while(t--) { cin>>n; cout<<(n+1>>1)<<endl; } return原创 2020-07-08 22:29:19 · 151 阅读 · 0 评论 -
思维入门1
A. 小 B 的异或小 B 收到了一串数字,其中包含nn个数字。寄件人想知道这nn个数的异或结果,但小 B 并不会求,就把这个问题转交给你。但他为了使你求得的更方便,于是运用魔法把这nn个数都变成了11。现在,你需要求出这nn个11异或后的结果。关于异或:下表为aa与bb的异或结果:aa bb a \oplus ba⊕b 11 00 11 11 11 00 00 00 00 00 ...原创 2020-07-01 21:57:13 · 913 阅读 · 0 评论 -
计算行列式
根据n阶行列式Det(a)的定义:n = 1 时,Det(a) = a[0][0]n = 2 时,Det(a) = a[0][0] * a[1][1] - a[1][0] * a[0][1]n > 2 时,Det(a) = sum(a[0][i] * (-1)^i * 去掉a[0][i]所在行列的n-1阶行列式的值)按照行列式的性质递归即可问题描述 //据说很多人的题目会有一大堆废话,本傻×就不在这里废话了。 给定一个N×N的矩阵A,求|A|。输入格式 ...原创 2020-05-12 22:45:04 · 2240 阅读 · 0 评论 -
Three Blocks Palindrome
The only difference between easy and hard versions is constraints.You are given a sequenceaaconsisting ofnnpositive integers.Let's define athree blocks palindromeas the sequence, consisting ...原创 2020-04-21 15:07:57 · 223 阅读 · 0 评论 -
Codeforces Round #634 (Div. 3)
题目A. Candies and Two Sisters直接签就行,规律是(n+1)/2-1,#include<iostream>typedef long long ll;using namespace std;int main(){ ios::sync_with_stdio(false); ll t,n; cin>>t; ...原创 2020-04-15 20:15:19 · 223 阅读 · 0 评论 -
2020蓝桥杯B组模拟
A. 结果填空:有趣的数字我们称一个数是质数,而且数位中出现了55的数字是有趣的。例如5,59,457都是有趣的,而15, 7不是。求1到100000 中有趣的数的个数。直接打表就可以,,最后结果3282.#include <bits/stdc++.h>using namespace std;bool fun(int n){ int sum=...原创 2020-04-07 11:11:09 · 890 阅读 · 3 评论 -
谁干得好事?
问题描述 ABCDE中num个人做了好事,truth个人说真话。 A说:“我和X中有且只有一个做了好事” B说:“C和E中有人做了好事” C说:“我和D和A中有人做了好事” D说:“B和C都没有做好事” E说:“我没有做好事” 请问有哪些人做了好事? 多组方案请一行一个输出。输入格式 仅一行,先是一个整数num,接着是一个A~E的字符X,最后是一个整数t...原创 2020-04-03 13:20:26 · 456 阅读 · 0 评论 -
Codeforces Round #629 (Div. 3)
题目点我A. Divisibility Problem求a加多少能够整除b,,如果a%b==0,,直接输出0,,如果不是,,+1减去现在的即可。#include<bits/stdc++.h>using namespace std;int main(){ ios::sync_with_stdio(false); int a,b,t; cin>>t;...原创 2020-03-28 16:39:59 · 194 阅读 · 0 评论 -
数的读法
问题描述 Tom教授正在给研究生讲授一门关于基因的课程,有一件事情让他颇为头疼:一条染色体上有成千上万个碱基对,它们从0开始编号,到几百万,几千万,甚至上亿。 比如说,在对学生讲解第1234567009号位置上的碱基时,光看着数字是很难准确的念出来的。 所以,他迫切地需要一个系统,然后当他输入12 3456 7009时,会给出相应的念法: 十二亿三千四百五十六万七千零九 用汉...原创 2020-03-26 20:25:33 · 434 阅读 · 0 评论 -
K倍区间
问题描述 给定一个长度为N的数列,A1, A2, ... AN,如果其中一段连续的子序列Ai, Ai+1, ... Aj(i <= j)之和是K的倍数,我们就称这个区间[i, j]是K倍区间。 你能求出数列中总共有多少个K倍区间吗?输入格式 第一行包含两个整数N和K。(1 <= N, K <= 100000) 以下N行每行包含一个整数Ai。(1 <=...原创 2020-03-24 22:31:24 · 262 阅读 · 0 评论 -
审美课(位运算+map标记)
问题描述 《审美的历程》课上有n位学生,帅老师展示了m幅画,其中有些是梵高的作品,另外的都出自五岁小朋友之手。老师请同学们分辨哪些画的作者是梵高,但是老师自己并没有答案,因为这些画看上去都像是小朋友画的……老师只想知道,有多少对同学给出的答案完全相反,这样他就可以用这个数据去揭穿披着皇帝新衣的抽象艺术了(支持帅老师^_^)。 答案完全相反是指对每一幅画的判断都相反。输入格式 第...原创 2020-03-20 11:58:00 · 112 阅读 · 0 评论 -
Codeforces Round #628D
D. Ehab the Xorcisttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputGiven 2 integersuuandvv, find the shortest array such that...原创 2020-03-16 23:21:26 · 181 阅读 · 0 评论 -
Codeforces Round #628C
C. Ehab and Path-etic MEXstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a tree consisting ofnnnodes. You want t...原创 2020-03-16 19:51:42 · 169 阅读 · 0 评论 -
Codeforces Round #627 (Div. 3)
题目链接A. Yet Another Tetris Problem若两个相邻方块之差不是偶数,则NO#include <bits/stdc++.h>using namespace std;typedef long long ll;int a[111],b[111];int main(){ ios::sync_with_stdio(false); ...原创 2020-03-14 22:17:54 · 128 阅读 · 0 评论 -
codeforces1312 C
C. Adding Powerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSuppose you are performing the following algorithm. There is an ...原创 2020-03-10 16:52:48 · 206 阅读 · 0 评论 -
codeforces 1312 A B
A. Two Regular Polygonstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two integersnnandmm(m<nm<n). Consi...原创 2020-03-10 16:45:19 · 231 阅读 · 0 评论 -
Codeforces Round #303 A C D
A. Toy CarsLittle Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph....原创 2020-03-06 15:47:54 · 249 阅读 · 0 评论 -
codeforces.contest1305problemA/B
A. Kuroni and the GiftsKuroni hasnndaughters. As gifts for them, he boughtnnnecklaces andnnbracelets:theii-th necklace has a brightnessaiai, where all theaiaiarepairwise distinct(i.e. ...原创 2020-03-04 21:12:09 · 329 阅读 · 0 评论 -
https://codeforces.com/contest/1311F. Moving Points
F. Moving Pointstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere arennpoints on a coordinate axisOXOX. Theii-th point i...原创 2020-02-29 17:02:36 · 691 阅读 · 0 评论 -
Codeforces Round #624D. Three Integers(思维+暴力枚举)
D. Three Integerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given three integersa≤b≤ca≤b≤c.In one move, you can ...原创 2020-02-27 15:54:00 · 312 阅读 · 0 评论 -
AtCoder Beginner Contest 156D - Bouquet(Lacus)
Time Limit: 2 sec / Memory Limit: 1024 MBScore :400400pointsProblem StatementAkari hasnnkinds of flowers, one of each kind.She is going to choose one or more of these flowers to make a bou...原创 2020-02-24 20:24:19 · 539 阅读 · 0 评论 -
Codeforces Round #618 (Div. 2)D,E
D. Aerodynamictime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputProblem DescriptionGuy-Manuel and Thomas are going to build a polygon sp...原创 2020-02-11 23:01:13 · 317 阅读 · 0 评论 -
Codeforces Round #618C
time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnu has created her own function f: f(x,y)=(x|y)−y where | denotes the bitwise OR operation. Fo...原创 2020-02-10 23:04:45 · 167 阅读 · 0 评论 -
C. Constanze's Machine(斐波那契数列+整数相乘)
C. Constanze's Machinetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputConstanze is the smartest girl in her village but she has b...原创 2019-11-07 22:37:24 · 342 阅读 · 0 评论 -
思维水题
B. PIN Codestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA PIN code is a string that consists of exactly44digits. Examples o...原创 2019-12-01 11:13:28 · 160 阅读 · 0 评论 -
H. Prince and Princess(南京区域赛)
莫契王国的莫奇王子爱上了托福王国的托福公主,但托福王国的女王不同意这一婚姻。女王挑战了他们的爱,并倡导给莫奇王子一项任务。解决这个问题是他们获得幸福的前提。由于缺乏能力,莫奇王子不得不向你求助。任务是:托福公主、托福国王、王后、大臣、女仆、厨师和许多其他人在一起完成这项任务,所有的人都住在单独的房间里。请注意,这里没有空房间。他们每个人都知道自己在哪里,也知道其他人在哪里。莫奇王子被要...原创 2019-12-03 15:38:58 · 666 阅读 · 0 评论 -
银川网络赛 B. Rolling The Polygon
昨天的比赛我自己就出了这道题,但中间有许多煎熬,,因为一个PI的精度问题我WA了十次,后来同学说精度应该改成acos(-1),才过了。Bahiyyah has a convex polygon withnnverticesP_0, P_1, \cdots , P_{n-1}P0,P1,⋯,Pn−1in the counterclockwise order. Two vertice...原创 2019-09-01 08:27:52 · 138 阅读 · 0 评论 -
CodeForces - 266C
You are given a square matrix consisting ofnrows andncolumns. We assume that the rows are numbered from1tonfrom top to bottom and the columns are numbered from1tonfrom left to right. Some c...原创 2019-08-21 23:18:54 · 156 阅读 · 0 评论 -
CodeForces - 260C (思维模拟)
Little Vasya hadnboxes with balls in the room. The boxes stood in a row and were numbered with numbers from 1 tonfrom left to right.Once Vasya chose one of the boxes, let's assume that its numbe...原创 2019-08-21 17:37:26 · 142 阅读 · 0 评论 -
爱奇艺的自制节目(贪心)
131072K爱奇艺作为一家视频网站巨头,要为上亿的用户每天都提供“悦享品质”的服务。除了引进一些优秀的影视作品外,爱奇艺还做了一些诸如奇葩说、晓松奇谈的自制节目。爱奇艺最近又准备制作四档新的节目,它们分别是 W, X, Y, Z;但是现在能用来录这些节目的演播室只有两个,分别是演播室 A 和演播室 B。W 节目的现场搭建比较复杂,每一期都要在演播室 A 来录制,X 节目的摄影机位调整会影...原创 2019-09-12 20:33:31 · 232 阅读 · 0 评论 -
结题报告-Olympiad
D. Olympiadtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA boy named Vasya has taken part in an Olympiad. His teacher knows tha...原创 2019-07-27 11:23:46 · 183 阅读 · 0 评论 -
结题报告-最小区间
B. Arraytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou've got an arraya, consisting ofnintegers:a1, a2, ..., an. Your t...原创 2019-07-25 09:44:14 · 326 阅读 · 0 评论 -
山峰
Little Bolek has found a picture withnmountain peaks painted on it. Thenpainted peaks are represented by a non-closed polyline, consisting of2nsegments. The segments go through2n + 1points wit...原创 2019-07-22 21:50:00 · 168 阅读 · 0 评论 -
结题报告-仙女教母的诅咒
Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which demons...原创 2019-06-09 13:00:25 · 270 阅读 · 0 评论 -
结题报告-排列队形的次数
A Ministry for Defense sent a general to inspect the Super Secret Military Squad under the command of the Colonel SuperDuper. Having learned the news, the colonel ordered to allnsquad soldiers to li...原创 2019-06-09 12:52:03 · 123 阅读 · 0 评论 -
结题报告-2的整数次幂的种类
Farmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an integer power of 2. Here are the possible sets of numbers that ...原创 2019-06-02 13:08:02 · 175 阅读 · 0 评论 -
CodeForces - 253C Text Editor(枚举+贪心)
C. Text Editortime limit per test1 secondmemory limit per test256 megabytesinputinput.txtoutputoutput.txtVasya is pressing the keys on the keyboard reluctantly, squeezing out his ide...原创 2019-08-15 23:31:17 · 168 阅读 · 0 评论 -
POJ - 2531 Network Saboteur
Network SaboteurTime Limit:2000MS Memory Limit:65536K Total Submissions:15496 Accepted:7667 DescriptionA university network is composed of N computers. System administrator...原创 2019-08-16 16:09:59 · 151 阅读 · 0 评论