HDU 2007】的更多相关文章

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2007 题目大意:给你段连续数字,让你求 all sum of (偶数2 )and all sum of (奇数3 ) 解题思路: 暴力遍历这段数字,判断奇偶数,搞一下就行,但对于弱菜的我来说还是学到挺多的. 先上代码吧 代码: #include<iostream> #include<cmath> #include<cstdio> #include<iomanip>…
/*杭电ACM ID:2007*/ #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main() { int in1, in2, out1, out2; int temp = 0, min, max; while (scanf("%d %d", &in1, &in2) != EOF){ if (in1 < in2){ min = in1; max = in2; } else{ min = i…
题目大意: 给定一段连续的整数,求出他们中所有偶数的平方和以及所有奇数的立方和. 解答: 坑你没商量!要考虑输入数a,b的大小.如果a>b,需要交换a,b的值. 1: #include<stdio.h> 2: #include<stdlib.h> 3: int main(){ 4: int a,b,i; 5: while(scanf("%d %d",&a,&b)!=EOF){ 6: long sum1=0,sum2=0; 7: if(a&g…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1853 Cyclic Tour Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/65535 K (Java/Others)Total Submission(s): 2289    Accepted Submission(s): 1162 Problem Description There are N cities in our…
Cyclic Tour Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/65535 K (Java/Others) Total Submission(s): 1120    Accepted Submission(s): 579 Problem Description There are N cities in our country, and M one-way roads connecting them. Now L…
PS:做到第四题才发现 2,3题的路径压缩等于没写 How Many Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14542    Accepted Submission(s): 7132 Problem Description Today is Ignatius' birthday. He invites a lot…
A Simple Game Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/65535 K (Java/Others)Total Submission(s): 1487    Accepted Submission(s): 939 Problem Description Agrael likes play a simple game with his friend Animal during the classes. I…
More is better Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 327680/102400 K (Java/Others)Total Submission(s): 12171    Accepted Submission(s): 4481 Problem Description Mr Wang wants some boys to help him with a project. Because the project…
Cyclic Tour Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/65535 K (Java/Others)Total Submission(s): 1197    Accepted Submission(s): 626 Problem Description There are N cities in our country, and M one-way roads connecting them. Now Li…
Cyclic Tour Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/65535 K (Java/Others)Total Submission(s): 2399    Accepted Submission(s): 1231 Problem Description There are N cities in our country, and M one-way roads connecting them. Now L…