10763:水题不解释直接贴代码. #include <iostream> #include <string.h> #include <stdio.h> #include <algorithm> #include <math.h> #include <queue> #define eps 1e-9 typedef long long ll; using namespace std; int n; ]; int main() { int…
题意:有若干交换生.若干学校,有人希望从A校到B校,有的想从B到C.C到A等等等等.如果有人想从A到B也刚好有人想从B到A,那么可以交换(不允许一对多.多对一).看作后如果有人找不到人交换,那么整个交换计划失败. 代码:(Accepted, 50ms) //UVa10763 - Foreign Exchange #include<cstdio> #include<cstring> int N, a, b,all[1003][1003]; int main() { //freopen…
题意:给出很多对数字,看看每一对(a,b)能不能找到对应的(b,a). 放在贪心这其实有点像检索. 用stl做,map+pair. 记录每一对出现的次数,然后遍历看看对应的那一对出现的次数有没有和自己出现的此时一样即可. 代码: /* * Author: illuz <iilluzen@gmail.com> * Blog: http://blog.csdn.net/hcbbt * File: uva10763.cpp * Lauguage: C/C++ * Create Date: 2013-…
 10763 Foreign ExchangeYour non-profit organization (iCORE - international Confederation of Revolver Enthusiasts) coordinatesa very successful foreign student exchange program. Over the last few years, demand hassky-rocketed and now you need assistan…
 Foreign Exchange Your non-profit organization (iCORE - international Confederation of Revolver Enthusiasts) coordinates a very successful foreign student exchange program. Over the last few years, demand has sky-rocketed and now you need assistance…
Foreign Exchange Your non-profit organization (iCORE - international Confederation of Revolver Enthusiasts) coordinates a very successful foreign student exchange program. Over the last few years, demand has sky-rocketed and now you need assistance w…
题目连接:10763 Foreign Exchange 题目大意:给出交换学生的原先国家和所去的国家,交换成功的条件是如果A国给B国一个学生,对应的B国也必须给A国一个学生,否则就是交换失败. 解题思路: 给出数据  10 x  y 1 2 2 1 3 4 4 3 100 200 200 100 57 2 2 57 1 2 2 1 按照排序: xy y x 12 1 2 12 1 2 21 2 1 21 2 1 257 2 57   34 3 4  43 4 3 572 57 2 100 200…
题目:10763 - Foreign Exchange 题目大意:给出每一个同学想要的交换坐标 a, b 代表这位同学在位置a希望能和b位置的同学交换.要求每一位同学都能找到和他交换的交换生. 解题思路:把给定的原先给定的序列,交换前后位置后得到新的序列. 假设这个新的序列和原来的序列同样就符合要求.由于  (a.b) (b. a)若是成对出现.那么前后交换后还是(b. a)(a.b). 代码: #include <stdio.h> #include <string.h> #inc…
Foreign Exchange Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Your non-profit organization (iCORE - international Confederation of Revolver Enthusiasts) coordinates a very successful foreign student exchange program. Over th…
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight Moves1101 Gamblers1204 Additive equations 1221 Risk1230 Legendary Pokemon1249 Pushing Boxes 1364 Machine Schedule1368 BOAT1406 Jungle Roads1411 Annive…
G - Brain Network (easy) Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u CodeForces 690C1 Description One particularly well-known fact about zombies is that they move and think terribly slowly. While we still don't know…
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3049    Accepted Submission(s): 2364 Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of…
CSU 1772 漫漫上学路 Time Limit: 1000MS   Memory Limit: 131072KB   64bit IO Format: %lld & %llu Submit Status Description 对于csuxushu来说,能够在CSU(California State University)上学是他一生的荣幸.CSU校园内的道路设计的十分精巧,由n+1条水平道路和n+1条竖直道路等距交错而成,充分体现了校园深厚的文化底蕴.然而不幸的是CS市每到夏季,天降大雨,…
1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 154  Solved: 112[Submit][Status][Web Board] Description 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换. Input 一个3x3的矩阵 Output 转置后的矩阵 Sample Input 1 2 3 4 5 6 7 8 9 Sample Output 1 4 7…
DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers. Write a program to find and print…
1195: 相信我这是水题 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 821  Solved: 219 Description GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,萌萌的师弟师妹们们经常会让pigofzhou帮他们Debug,因为师弟师妹们打代码使用编程语言的种类千奇百怪,pigofzhou为此很头疼.现在假设师弟师妹们只喜欢Java或者C++或者C,因为他希望所有人都学相同的编程语言,只有这样pigofzhou教…
1303: [CQOI2009]中位数图 Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 2340  Solved: 1464[Submit][Status][Discuss] Description 给出1~n的一个排列,统计该排列有多少个长度为奇数的连续子序列的中位数是b.中位数是指把所有元素从小到大排列后,位于中间的数. Input 第一行为两个正整数n和b ,第二行为1~n 的排列. Output 输出一个整数,即中位数为b的连续子序列个数.…
B - 大还是小? Time Limit:5000MS     Memory Limit:65535KB     64bit IO Format: Description 输入两个实数,判断第一个数大,第二个数大还是一样大.每个数的格式为: [整数部分].[小数部分] 简单起见,整数部分和小数部分都保证非空,且整数部分不会有前导 0.不过,小数部分的最 后可以有 0,因此 0.0 和 0.000 是一样大的. Input 输入包含不超过 20 组数据.每组数据包含一行,有两个实数(格式如前所述)…
ACM小白...非常费劲儿的学习中,我觉得目前我能做出来的都可以划分在水题的范围中...不断做,不断总结,随时更新 POJ: 1004 Financial Management 求平均值 杭电OJ: 1001  Sum Problem 相加1002  A + B Problem II 模拟人工加法-精度计算 1008 Elevator 很水,但是情况要考虑全面…
Codeforces Round #258 (Div. 2) Predict Outcome of the Game C. Predict Outcome of the Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n games in a football tournament. Three…
Codeforces Round #258 (Div. 2) Sort the Array B. Sort the Array time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Being a programmer, you like arrays a lot. For your birthday, your friends ha…
Codeforces Round #258 (Div. 2) Game With Sticks A. Game With Sticks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output After winning gold and silver in IOI 2014, Akshat and Malvika want to hav…
题意就是讲给出的字符串元音字母去掉,在每个辅音字母前加点,且小写输出...注意y也要去掉(以我英语挂科的水平也知道y是辅音字母)... 水题.. 直接上代码好了... #include <iostream> #include <stdio.h> #include <string.h> #define MAXN 100+10 using namespace std; char s[]={"aeiouAEIOUyY"}; int main(void) {…
1061: 从三个数中找出最大的数 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 154  Solved: 124[Submit][Status][Web Board] Description 定义一个带参的宏(或者模板函数),从三个数中找出最大的数. Input 3个短整型数,空格隔开 3个实数,空格隔开 3个长整数,空格隔开 Output 最大的数,对于实数保留2位小数. Sample Input 1 2 3 1.5 4.7 3.2 12345…
1059: 判别该年份是否闰年 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 222  Solved: 139[Submit][Status][Web Board] Description 给年份year,定义一个宏,以判别该年份是否闰年.提示:宏名可以定义为LEAP_YEAR,形参为y,既定义宏的形式为 #define LEAP_YEAR(y) (读者设计的字符串) Input 一个年份 Output 根据是否闰年输出,是输出"L",否…
1064: 输入三个字符串,按由小到大的顺序输出 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 471  Solved: 188[Submit][Status][Web Board] Description 输入三个字符串,按由小到大的顺序输出.分别使用指针和引用方式实现两个排序函数.在主函数中输入和输出数据. Input 3行字符串 Output 按照从小到大输出成3行.由指针方式实现. 按照从小到大输出成3行.由引用方式实现.   Sample…
LSS Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 128000/64000 KB (Java/Others) SubmitStatistic Next Problem Problem Description Time flies, four years passed, colleage is over. When I am about to leave, a xuemei ask me an ACM  problem, but…
DNA Sorting Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 80832   Accepted: 32533 Description One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instanc…
Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 110991   Accepted: 34541 Description Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical,…
487-3279 Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 236746   Accepted: 41288 Description Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phras…