#include<stdio.h> #include<algorithm> #include<math.h> using namespace std; int canzhao[100000],canzhao2[100000],laike[10005]; //分别存储谁是谁的配偶,标记这个来客的配偶已经来了,来的客人 bool cmp(int a,int b){ return a<b; } int main(){ int N,M;scanf("%d&quo
1121 Damn Single (25 分) "Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of. Input Specification: Each input file contains one tes
1090 危险品装箱 (25分) 集装箱运输货物时,我们必须特别小心,不能把不相容的货物装在一只箱子里.比如氧化剂绝对不能跟易燃液体同箱,否则很容易造成爆炸. 本题给定一张不相容物品的清单,需要你检查每一张集装箱货品清单,判断它们是否能装在同一只箱子里. 输入格式: 输入第一行给出两个正整数:N (≤) 是成对的不相容物品的对数:M (≤) 是集装箱货品清单的单数. 随后数据分两大块给出.第一块有 N 行,每行给出一对不相容的物品.第二块有 M 行,每行给出一箱货物的清单,格式如下: K G
1114 Family Property (25 分) This time, you are supposed to help us collect the data for family-owned property. Given each person's family members, and the estate(房产)info under his/her own name, we need to know the size of each family, and the average
1044 Shopping in Mars (25 分) Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making the payment, the chain can be cut at any position for only once and som