QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#51522#4541. Black MagicAmalgadon#AC ✓14ms3652kbC++17344b2022-10-02 16:03:472022-10-02 16:03:48

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-02 16:03:48]
  • Judged
  • Verdict: AC
  • Time: 14ms
  • Memory: 3652kb
  • [2022-10-02 16:03:47]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int T; cin>>T;
    while(T--)
    {
        int E,L,R,B;
        cin>>E>>L>>R>>B;
        int e=E,l=L,r=R,b=B;
        b=min(b,1);
        if(l||r) b=0;
        printf("%d ",e+b+l+r-min(l,r));
        e=E,l=L,r=R,b=min(B,e+1);
        printf("%d\n",e+l+r+b);
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 14ms
memory: 3652kb

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