模拟题
small__snail__5
如果有一天您来到了这里请留下您的痕迹,欢迎各种评论,一同进步。
我愿意做一只小蜗牛,不艳羡别人的速度,而独享自己的慢慢旅程,总有一天,我也可以骄傲的告诉所有人,我虽然慢,但是我不曾放弃,人生总要坚持点什么。
展开
-
uva6692
/*此题题意是找到在序列t[i]中找出一个最大长度,条件是满足当前该值的后面有一个大于自己的,且离自己最远的长度*/ /*此题是一个不断维护当前最大的下标且输出最大的下标差值即可,注意更新条件即可*/ #include #include #include #include using namespace std; struct node{ int val, id; b原创 2017-04-28 10:18:38 · 214 阅读 · 0 评论 -
poj1068 Parencodings
//题意:输入t代表几组样例,n代表有几个右括号,n个数中第一个数代表第一个右括号前面有几个左括号,一次类推,题目问?在当前的括号里包括当前的括号共有几对括号//思路:1、首先将原来的括号川抽象为01数列,这里左括号为1,右括号为0,在输入每个数字的时候就很好的转化好这个川;2、建立映射关系,也就是说将当前这个右括号的下标与他对应的左括号的下标用map对应起来;3、用链表建立指向关系和值,每次判断...原创 2018-04-22 15:15:24 · 176 阅读 · 0 评论 -
poj 1008 Maya Calendar
//题意:玛雅人有两种计算年的,方法1):一年19个月,前18个月20天,弟19个月5天,共365天,每个月有自己的英文代号,天数、年份下标从0开始;方法2):一年分为13个月,每个月20天,共260天,每天有自己的英文代号;给出方法1中的某一天让你转换为方法二的某一天。输入:方法一的的 天数下标. 月份代号 年份下标 输出:数字(从1~13循环输出) 天的英文代号 年份下标(【注意】...原创 2018-04-17 22:16:56 · 216 阅读 · 0 评论 -
poj3295 Tautology
//题意:p,q,r,s,t分别带别可0可1的数字,A(w,x),N,E(w,x),C(w,x),K(w,x),分别代表逻辑运算分别为或、非、是否相等、非w或x、与;当然这里的w,x只是举例实则是pqrst,然后目的给你一个传操作若是永真式输出一个tautology,否则输出not//思路:自己构造一个栈,因为每种操作数都是在操作符后面的,从右向左入栈方便操作简单具体见代码(【注意】有个很奇怪的地...原创 2018-04-16 17:20:06 · 224 阅读 · 0 评论 -
codeforce3B
A group of tourists is going to kayak and catamaran tour. A rented lorry has arrived to the boat depot to take kayaks and catamarans to the point of departure. It's known that all kayaks are of the sa原创 2017-05-25 20:06:33 · 345 阅读 · 0 评论 -
codeforce 2A
A. Winner time limit per test 1 second memory limit per test 64 megabytes input standard input output standard output The winner of the card game popular in Berland "Berlogging" is determined accor原创 2017-05-23 22:40:14 · 314 阅读 · 0 评论 -
hdu1022(stack)
As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over t原创 2017-05-04 09:35:56 · 592 阅读 · 0 评论 -
hdu1896(优先队列)
Because of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back every evening. Walking may cause a little tired, so Sempr always play some games this time.原创 2017-05-03 23:24:18 · 619 阅读 · 0 评论 -
poj2503(stl, map ,sscanf)
#include #include #include #include #include using namespace std; int main() { char c1[30], c2[30], c3[30]; string ss; maps; while(gets(c1)){ if(strlen(c1) == 0) break;原创 2017-04-15 21:37:17 · 235 阅读 · 0 评论 -
poj2635(素数表)
The young and very promising cryptographer Odd Even has implemented the security module of a large system with thousands of users, which is now in use in his company. The cryptographic keys are create原创 2017-05-01 16:11:06 · 394 阅读 · 0 评论 -
Lowest Unique Price (第六届省赛)map
/*此题一定是一个大模拟map*/ #include #include #include #include #include using namespace std; int main() { int t; scanf("%d", &t); while(t--){ map s; s.clear(); int原创 2017-04-30 15:49:59 · 225 阅读 · 0 评论 -
hdu1263(map(自己定义的数据结构的map))
/*在自己定义的一个结构体中的map的运用和调用*/ #include #include #include #include #include using namespace std; struct myst{ map mp;//由于输出的原意需要自己定义 }; int main() { int t, n; scanf("%d", &t); map原创 2017-04-29 13:05:51 · 355 阅读 · 0 评论 -
hdu1075(map)
/*相当于你输入的串有个对照表,若该船和对照表中的串相同,那么输出对照表中的串*/ #include #include #include #include #include using namespace std; char c[3010]; map mp; int main() { string s1, s2; cin >> s1; while(cin原创 2017-04-29 09:36:08 · 280 阅读 · 0 评论 -
codeforce 4C
/*通过计数很简单的模拟stl*/ #include #include #include #include #include using namespace std; int main() { int n; while(cin >> n){ map mp; for(int i = 0; i < n; i++){原创 2017-04-13 17:32:33 · 333 阅读 · 0 评论 -
poj2632 Crashing Robots
//题意:题意很简单给一个坐标图,k代表样例个数,b,a代表举行长宽,n,m代表机器人数,指令数,n个表示机器人初始位置,m条指令,m条指令中F:直行,L:向左转(注意只是改变朝向,坐标不变)R:向右转(改变朝向,坐标不变)输出有三种情况:1.机器人可能走出这个表格撞墙;2.机器人撞到另一个机器人这两种情况;【注意:按照给的坐标的顺序就是机器人的编号】3.OK;是哪种情况就输出那种情况。【思路很简...原创 2018-04-24 17:20:32 · 155 阅读 · 0 评论