Princess Cjb is caught by Heltion again! Her knights Little Sub and Little Potato are going to Heltion Kingdom to rescue her. Heltion Kingdom is composed of islands, numbered from to . There are bridges in the kingdom, among which the -th bridge conn…
http://acm.zju.edu.cn/onlinejudge/showContestProblems.do?contestId=391 A     Thanks, TuSimple! Time Limit: 1 Second      Memory Limit: 65536 KB 题意:有t组数据,n个男生,m个女生,每个人身高不同,每个人都期望和比自己高或者比自己低的人跳舞,问最多有多少对舞伴 题解:把期待比自己高的男生身高和期待比自己低的男生身高分别存在两个数组a[n],b[n]里,同…
感想: 今天三个人的状态比昨天计院校赛的状态要好很多,然而三个人都慢热体质导致签到题wa了很多发.最后虽然跟大家题数一样(6题),然而输在罚时. 只能说,水题还是刷得少,看到签到都没灵感实在不应该. 题目链接:http://acm.zju.edu.cn/onlinejudge/showContestProblems.do?contestId=391 A:简单贪心,按高度sort一下就好了,这里用优先队列处理 #include <cstdio> #include <queue> #i…
传送门 题意: 给出了三个新定义: E-prime : ∀ num ∈ E,不存在两个偶数a,b,使得 num=a*b;(简言之,num的一对因子不能全为偶数) E-prime factorization : 定义集合P由 E-prime 元素组成,定义 e = p1*p2*.....*pn:(p1,p2,....,pn ∈ P , |P| = n) E-factorial : 定义 e!! = 2*4*6*8*.........*e:(简言之,偶数e及其之前的偶数连乘积) 输出一个数 e ,求…
题目链接:The 18th Zhejiang University Programming Contest Sponsored by TuSimple - G Traffic Light 题解: 题意自己翻译,此题首先肯定是要广搜的,不过要开一个1e5*1e5的数组好像有点困难, 所以用结构体来存每个点的下标,然后从源点开始广搜.定义一个pair<node,int>,第一个存节点信息,第二个存到当前节点的步数,因为还要处理到达每个节点的状态. 状态:走奇数步并且状态为1与走偶数步状态为0的结果…
Handshakes Time Limit: 2 Seconds      Memory Limit: 65536 KB Last week, n students participated in the annual programming contest of Marjar University. Students are labeled from 1 to n. They came to the competition area one by one, one after another…
题目链接 题意: 题意简单,就是一个简单的数据结构,对栈的模拟操作,可用链表实现,也可以用C++的模板类来实现,但是要注意不能用cin cout,卡时间!!! 代码: #include <stdio.h> #include <iostream> #include <vector> #include <deque> #include <list> #define IO ios::sync_with_stdio(0);\ cin.tie();cout…
Pretty Matrix Time Limit: 1 Second      Memory Limit: 65536 KB DreamGrid's birthday is coming. As his best friend, BaoBao is going to prepare a gift for him. As we all know, BaoBao has a lot of matrices. This time he picks an integer matrix with  row…
模拟题,用链表来进行模拟 # include <stdio.h> # include <stdlib.h> typedef struct node { int num; struct node *q; struct node *h; }node; struct Node { node *start; node *end; int sum; }m[]; int main() { int k; scanf("%d", &k); while (k--) { i…
Marjar Cola Time Limit: 1 Second      Memory Limit: 65536 KB Marjar Cola is on sale now! In order to attract more customers, Edward, the boss of Marjar Company, decides to launch a promotion: If a customer returns x empty cola bottles or y cola bottl…