LightOJ - 1001 Opposite Task
2015-01-10 22:37
148 查看
Description
This problem gives you a flavor the concept of special judge. That means the judge is smart enough to verify your code even though it may print different results. In this problem you are asked to find the opposite task of the previous problem.
To be specific, I have two computers where I stored my problems. Now I know the total number of problems is n. And there are no duplicate problems and there can be at most 10 problems in each computer. You have to find the
number of problems in each of the computers.
Since there can be multiple solutions. Any valid solution will do.
Input
Input starts with an integer T (≤ 25), denoting the number of test cases.
Each case starts with a line containing an integer n (0 ≤ n ≤ 20) denoting the total number of problems.
Output
For each case, print the number of problems stored in each computer in a single line. A single space should separate the non-negative integers.
Sample Input
3
10
7
7
Sample Output
0 10
0 7
1 6
题目的sample output貌似有问题,不过我这个提交就可以了,根据题意和输出大概意思是 b是先解决问题,如果b的解决问题大于10,就给a 10道,剩下给b
This problem gives you a flavor the concept of special judge. That means the judge is smart enough to verify your code even though it may print different results. In this problem you are asked to find the opposite task of the previous problem.
To be specific, I have two computers where I stored my problems. Now I know the total number of problems is n. And there are no duplicate problems and there can be at most 10 problems in each computer. You have to find the
number of problems in each of the computers.
Since there can be multiple solutions. Any valid solution will do.
Input
Input starts with an integer T (≤ 25), denoting the number of test cases.
Each case starts with a line containing an integer n (0 ≤ n ≤ 20) denoting the total number of problems.
Output
For each case, print the number of problems stored in each computer in a single line. A single space should separate the non-negative integers.
Sample Input
3
10
7
7
Sample Output
0 10
0 7
1 6
题目的sample output貌似有问题,不过我这个提交就可以了,根据题意和输出大概意思是 b是先解决问题,如果b的解决问题大于10,就给a 10道,剩下给b
#include <iostream> using namespace std; int main(){ int T; while(cin>>T){ while(T--){ int num; cin>>num; int a = 0, b = num; if(num > 10){ a = 10; b = num-10; } cout<<a<<" "<<b<<endl; } } }
相关文章推荐
- LightOj 1001 - Opposite Task (数值和的拆分)
- LightOJ-1001-Opposite Task
- lightoj1001【简单题】
- 基础数论 1001 LightOJ 1370
- lightoj 1021 - Painful Bases 状压DP
- 贪心算法 Problem B 1001
- LightOj 1220 Mysterious Bacteria(数论)
- bzoj 1001 狼抓兔子 平面图最小割
- SDAU 课程练习2 1001
- ACM第一次练习—1001B,1008I
- java_patest甲级真题1001. A+B Format
- LightOJ 1064 Throwing Dice
- LightOj 1122 Digit Count(数位dp)
- lightoj 1079 概率计算+01背包
- lightoj 1147 - Tug of War DP压位
- LightOJ 1173 The Vindictive Coach (DP)
- 搜索—Problem_1001-Can you solve this equation?
- lightoj 1246 - Colorful Board DP+组合数
- lightoj 1122 Digit Count
- LightOJ 1356 Prime Independence 二分图最大独立集,HK算法