QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#49516 | #4541. Black Magic | CDsmen# | AC ✓ | 3ms | 3724kb | C++ | 883b | 2022-09-21 20:00:11 | 2022-09-21 20:00:12 |
Judging History
answer
#include <bits/stdc++.h>
#define IO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long llint;
inline int read()
{
int ans = 0, w = 1;
char ch = getchar();
while (ch < '0' || ch > '9')
{
if (ch == '-')
w = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9')
{
ans = ans * 10 + ch - '0';
ch = getchar();
}
return ans * w;
}
inline void solve()
{
int a = read(), b = read(), c = read(), d = read();
int n = a + b + c + d;
int tmp = d - a;
printf("%d %d\n", n-min(b,c)-(max(b,c)!=0?d:(d==0?0:d-1)), n - max(0, tmp - 1));
}
int main()
{
// IO;
// init();
int tt = 1;
tt = read();
// scanf("%d", &tt);
while (tt--)
{
solve();
// cout << tt << endl;
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 3ms
memory: 3724kb
input:
4000 0 0 0 1 0 0 0 100000 0 0 0 11 0 0 0 12 0 0 0 13 0 0 0 2 0 0 0 25 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 6 0 0 0 7 0 0 0 8 0 0 0 9 0 0 1 0 0 0 1 1 0 0 1 12 0 0 1 14 0 0 1 17 0 0 1 2 0 0 1 21 0 0 1 3 0 0 1 4 0 0 1 5 0 0 1 6 0 0 1 7 0 0 1 8 0 0 1 9 0 0 100000 0 0 0 11 6 0 0 12 3 0 0 12 4 0 0 13 0 0 0 13 12...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 100000 100000 11 12 12 13 12 13 13 13 13 14 13 14 14 15 16 16 16 17 16 17 2 2 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 26 27 3 3 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 4 4 4 5 ...
result:
ok 4000 lines