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]里,同…
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…
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…
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…