摘要: 题很水,数据注意一下四点即可:1.有些team会在一道题AC了之后还提交,这个时候只需要算第一次ac的时间以及这之前的wa,之后的全部忽略。2.如果一道题没有ac,那么在计算时间时不应该加上它的wa带来的惩罚。3.先按做题最多的排,如相等,再按提交时间最少的排,如相等,再按队号最小的排。4.给的数据,提交的时间不是按顺序排的。#include #include #include #include using namespace std;const int maxn=1010;int C,N;int c,p,t,r;int res[maxn][maxn]; //res[c][p]=1表示队伍c. 阅读全文
posted @ 2013-09-26 21:00 辰曦~文若 阅读(431) 评论(0) 推荐(0)
摘要: 题意:有多组数据,每组数据给出n,m,n表示需要打印的文件个数,m表示要打印的目标位置(m为0~n-1)。 接下来给出n个数,第i个值对应第i-1个位置的优先级大小。 打印规则如下: 将队列中的第一个打印工作J从队列中取出; 如果在队列中有优先级高于J的打印工作,则不打印J,将J移到队列最后端; 否则打印J。 每打印一个需要1分钟,问到目标文件被打印完成需要多少分钟。#include #include #include #include using namespace std;const int maxn=110;int q[maxn]; //模拟的队列int t,n,m;int first. 阅读全文
posted @ 2013-09-26 16:19 辰曦~文若 阅读(1417) 评论(0) 推荐(0)
摘要: 题意:关于!,&,| 的运算,表达式中V代表true,F代表false。思路:见代码吧,很详细了。 要注意 !!!F,!(...) 的情况。#include #include #include #include #include using namespace std;const int maxn=105;stack val; //存储操作数和中间运算结果stack op; //存储运算符map maps; //存储相应运算符的优先级,数值大代表优先级高//求!avoid opNot(int a){ while(!op.empty() && op.top()==' 阅读全文
posted @ 2013-09-26 13:15 辰曦~文若 阅读(2780) 评论(0) 推荐(0)