Loading

随笔分类 -  刷题笔记----------

摘要:Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of ol 阅读全文
posted @ 2020-06-24 22:58 RioTian 阅读(197) 评论(0) 推荐(0)
摘要:原题链接 KMP模板:AC,858ms,13112KB内存 消耗太大了 #include<bits/stdc++.h> using namespace std; using namespace std; #define ms(x, n) memset(x,n,sizeof(x)); typedef 阅读全文
posted @ 2020-06-23 20:38 RioTian 阅读(156) 评论(0) 推荐(0)
摘要:The end of the school year is near and Ms. Manana, the teacher, will soon have to say goodbye to a yet another class. She decided to prepare a goodbye 阅读全文
posted @ 2020-06-23 20:24 RioTian 阅读(188) 评论(0) 推荐(0)
摘要:Being a nonconformist, Volodya is displeased with the current state of things, particularly with the order of natural numbers (natural number is posit 阅读全文
posted @ 2020-06-23 20:06 RioTian 阅读(469) 评论(0) 推荐(0)
摘要:原题链接 ╮(╯▽╰)╭这题题目一开始没看明白,导致wa几次。如果全是大写或者出了首字母是小写其他为大写,则转换为第一个字母大写,其他的小写 ,如果不是以上两种情况则不作处理。 ╮(╯▽╰)╭水题还错。 #include<bits/stdc++.h> using namespace std; int 阅读全文
posted @ 2020-06-19 11:42 RioTian 阅读(155) 评论(0) 推荐(0)
摘要:5436. 一维数组的动态和 时间复杂度:O(n) 知识点:前缀和 根据题目给出的公式 runningSum[i] = sum(nums[0]…nums[i]),可得: 当 i > 0 时,runningSum[i] = runningSum[i-1] + nums[i] 当 i = 0 时,run 阅读全文
posted @ 2020-06-16 20:58 RioTian 阅读(239) 评论(0) 推荐(0)
摘要:Problem Description The twenty-first century is a biology-technology developing century. We know that a gene is made of DNA. The nucleotide bases from 阅读全文
posted @ 2020-06-12 21:01 RioTian 阅读(199) 评论(0) 推荐(0)
摘要:Descriptions: 一个人从(0,0)跑到(n,m),只有k点能量,一秒消耗一点,在图中有k个炮塔,给出炮塔的射击方向c,射击间隔t,子弹速度v,坐标x,y 问这个人能不能安全到达终点 要求: 1.人不能到达炮塔所在的坐标 2.炮塔会挡住子弹 3.途中遇到子弹是安全的,但是人如果停在这个坐标 阅读全文
posted @ 2020-06-12 15:26 RioTian 阅读(436) 评论(0) 推荐(0)
摘要:Descriptions: 一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 Input 前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1.m=0退出. Output 输 阅读全文
posted @ 2020-06-12 14:59 RioTian 阅读(132) 评论(0) 推荐(0)
摘要:题目描述 简单介绍一下八数码问题: 在一个3×3的九宫格上,填有1~8八个数字,空余一个位置,例如下图: 1 2 3 4 5 6 7 8 在上图中,由于右下角位置是空的,你可以移动数字,比如可以将数字6 下移一位: 1 2 3 1 2 3 4 5 6 → 4 5 7 8 7 8 6 或者将数字 8 阅读全文
posted @ 2020-06-12 14:36 RioTian 阅读(175) 评论(0) 推荐(0)
摘要:题目: 给你两个容器,分别能装下A升水和B升水,并且可以进行以下操作 FILL(i) 将第i个容器从水龙头里装满(1 ≤ i ≤ 2); DROP(i) 将第i个容器抽干 POUR(i,j) 将第i个容器里的水倒入第j个容器(这次操作结束后产生两种结果,一是第j个容器倒满并且第i个容器依旧有剩余,二 阅读全文
posted @ 2020-06-10 22:07 RioTian 阅读(169) 评论(0) 推荐(0)
摘要:一、内容 题意:给定2个字符串s1,s2,将2个字符串进行重组成S,规则是S2最下面拿一个,S1最下面拿1个,直到所有块都用完。 二、思路 用map记录下S串结果,若以前访问过这个串代表不可能有结果直接返回-1。 然后就是模拟重组串的过程。 三、代码 #include<iostream> #incl 阅读全文
posted @ 2020-06-10 16:15 RioTian 阅读(135) 评论(0) 推荐(0)
摘要:题目: 给定一个正整数n,请编写一个程序来寻找n的一个非零的倍数m,这个m应当在十进制表示时每一位上只包含0或者1。你可以假定n不大于200且m不多于100位。 提示:本题采用Special Judge,你无需输出所有符合条件的m,你只需要输出任一符合条件的m即可。 输入: 输入包含多组数据,每组数 阅读全文
posted @ 2020-06-10 15:05 RioTian 阅读(95) 评论(0) 推荐(0)
摘要:思路: 模板题,一步一步加入集合,最后判断有多少人跟0在同一个集合就行了。 #include<iostream> #include<cstdio> using namespace std; const int manx = 3e4 + 5; int a[manx]; int find(int x){ 阅读全文
posted @ 2020-06-09 21:18 RioTian 阅读(105) 评论(0) 推荐(0)
摘要:题目大意: 见《挑战程序设计竞赛》P74。 我的理解: 优先队列+贪心 注意把输入的距离(加油站到终点)改为起点到加油站。 因为求得是最优解,需要尽可能少的加油站,所以我们每次希望去加油的时候 加最大的那个,因而将加油站push进priority_queue(堆结构,默认每次弹出最大值) 在到达加油 阅读全文
posted @ 2020-06-09 16:31 RioTian 阅读(128) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-06-06 21:56 RioTian 阅读(0) 评论(0) 推荐(0)
摘要:1. 4A.Watermelon **题目链接:**https // s.com/problemset/problem/4/A **题意:**两人分瓜,但每一部分都得是偶数 **分析:**直接 对2取余,且 w != 2 #include<bits/stdc++.h> using namespace 阅读全文
posted @ 2020-06-05 19:53 RioTian 阅读(273) 评论(0) 推荐(0)
摘要:古语有云,“笑人情似纸,世事如棋”。生活中每个人如同棋手,其每一个行为如同在一张看不见的棋盘 上布子,精明慎重的棋手们相互揣摩、牵制、争赢,下出诸多精彩纷呈、变化多端的棋局。而什么是博 弈论?就是研究棋手们 的“出棋” 过程,从中抽象出可逻辑化的部分,并将其系统化的一门科学,也是运 筹学的一个重要学 阅读全文
posted @ 2020-06-02 18:18 RioTian 阅读(1175) 评论(0) 推荐(1)
摘要:会引起 Compile Error 的错误 由于这类错误过于简单,相信是个正常人都会修,故略写。 int main() 写为 int mian() 。 写完 struct 或 class 忘记写分号。 数组开太大,(在 OJ 上)使用了不合法的函数(例如多线程),或者函数声明但未定义,会引起链接错误 阅读全文
posted @ 2020-06-01 12:06 RioTian 阅读(735) 评论(0) 推荐(2)
摘要:题目链接:http://poj.org/problem?id=2484 题意:Alice和Bob玩游戏,从一堆圆环形排列的硬币中拿硬币,每次可以拿一个或者两个,但必须拿连续的(两个中间有空位也视为不连续),Alice先手,给定硬币个数,问谁赢。 题解: 当n=1或者n=2时,Alice可以一下子取走 阅读全文
posted @ 2020-05-30 21:16 RioTian 阅读(172) 评论(0) 推荐(0)