浙大pat 1037】的更多相关文章

1037. Magic Coupon (25) 时间限制 100 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you m…
1001. 害死人不偿命的(3n+1)猜想 1002. 写出这个数 1003. 我要通过! 1004. 成绩排名 1005. 继续(3n+1)猜想 1006. 换个格式输出整数 1007. 素数对猜想 1008. 数组元素循环右移问题 1009. 说反话 1010. 一元多项式求导 1011. A+B和C 1012. 数字分类 1013. 数素数 1014. 福尔摩斯的约会 1015. 德才论 1016. 部分A+B 1017. A除以B 1018. 锤子剪刀布 1019. 数字黑洞 1020.…
pat链接:http://pat.zju.edu.cn 1 #include<stdio.h> 2 int main(){ 3 int a,b; 4 int c; 5 while(scanf("%d %d",&a,&b)!=EOF){ 6 c=a+b; 7 if(c<0){ 8 c=-c; 9 printf("-"); 10 } 11 if(c>=1000000) 12 printf("%d,%03d,%03d\n&…
1035. Password (20) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is…
1025. PAT Ranking (25) 时间限制 200 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneous…
1037 在霍格沃茨找零钱(20)(20 分) 如果你是哈利·波特迷,你会知道魔法世界有它自己的货币系统 -- 就如海格告诉哈利的:"十七个银西可(Sickle)兑一个加隆(Galleon),二十九个纳特(Knut)兑一个西可,很容易."现在,给定哈利应付的价钱P和他实付的钱A,你的任务是写一个程序来计算他应该被找的零钱. 输入格式: 输入在1行中分别给出P和A,格式为"Galleon.Sickle.Knut",其间用1个空格分隔.这里Galleon是[0, 10^…
如果你是哈利·波特迷,你会知道魔法世界有它自己的货币系统 —— 就如海格告诉哈利的:“十七个银西可(Sickle)兑一个加隆(Galleon),二十九个纳特(Knut)兑一个西可,很容易.”现在,给定哈利应付的价钱P和他实付的钱A,你的任务是写一个程序来计算他应该被找的零钱. 输入格式: 输入在1行中分别给出P和A,格式为“Galleon.Sickle.Knut”,其间用1个空格分隔.这里Galleon是[0, 107]区间内的整数,Sickle是[0, 17)区间内的整数,Knut是[0, 2…
1037 Magic Coupon(25 分) The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N times the value of that product back! What is more, the sho…
如果你是哈利·波特迷,你会知道魔法世界有它自己的货币系统 -- 就如海格告诉哈利的:"十七个银西可(Sickle)兑一个加隆(Galleon),二十九个纳特(Knut)兑一个西可,很容易."现在,给定哈利应付的价钱P和他实付的钱A,你的任务是写一个程序来计算他应该被找的零钱. 输入格式: 输入在1行中分别给出P和A,格式为"Galleon.Sickle.Knut",其间用1个空格分隔.这里Galleon是[0, 107]区间内的整数,Sickle是[0, 17)区间…
1021: #include<stdio.h> #include<string.h> #include<vector> #include<queue> using namespace std; #define N 10005 vector<int> v[N]; queue<int> q; int tree[N],h[N],dis[N],vis[N]; int n,maxh; int findroot(int x){ ) return…