UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#152563#961. 知识竞赛139155802521000ms1184kbC++265b2022-08-01 10:09:242022-08-01 10:09:24

answer

#include<bits/stdc++.h>
using namespace std;
int n, m;
int main()
{
	cin >> n >> m ;
	for(int i = 0; i <= n; i++)
		for(int j = 0; j + i <= n; j++)
			if(i * 8 - j * 5 == m)
			{
				printf("%d %d %d", i, j, n - i - j);
				return 0;
			}
	return 0;
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 33
Accepted
time: 0ms
memory: 1180kb

input:

20 55

output:

10 5 5

result:

ok single line: '10 5 5'

Test #2:

score: 33
Accepted
time: 0ms
memory: 1184kb

input:

20 13

output:

6 7 7

result:

ok single line: '6 7 7'

Test #3:

score: 33
Accepted
time: 0ms
memory: 1180kb

input:

25 114

output:

18 6 1

result:

ok single line: '18 6 1'