QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#417959#1827. Token Gameucup-team1716#WA 22ms3680kbC++20777b2024-05-23 05:47:032024-05-23 05:47:04

Judging History

你现在查看的是最新测评结果

  • [2024-05-23 05:47:04]
  • 评测
  • 测评结果:WA
  • 用时:22ms
  • 内存:3680kb
  • [2024-05-23 05:47:03]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
#define pb push_back

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	int t = 1;
	cin >> t;
    while(t-->0)
    {
        int x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;

        int ans = 0;
        ans += (x1==y1) ^ (x2==y2);

        if(x1 != y1)
        {
            if(x2 == y1 && y2 > x1) ans++;
            if(y2 == x1 && x2 > y1) ans++;
        }
        if(x2 != y2)
        {
            if(x1 == y2 && y1 > x2) ans++;
            if(y1 == x2 && x1 > y2) ans++;
        }

        if(x1 == x2 || y1 == y2) ans++;
        if(abs(x1-x2) == 1 || abs(y1-y2) == 1) ans++;

        cout << ans << "\n";
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3616kb

input:

5
6 6 6 3
6 6 2 2
1 6 3 1
3 6 1 3
6 3 1 5

output:

3
0
1
1
0

result:

ok 5 number(s): "3 0 1 1 0"

Test #2:

score: -100
Wrong Answer
time: 22ms
memory: 3680kb

input:

100000
215 233 28 258
15 243 61 148
172 28 96 37
15 132 62 27
41 186 255 54
145 192 249 263
274 70 185 197
50 101 202 230
256 11 285 19
149 268 163 107
177 201 216 126
65 17 105 263
143 148 2 230
40 128 259 176
183 192 293 169
281 59 240 229
257 157 126 182
161 51 164 14
149 191 227 102
55 14 267 19...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
...

result:

wrong answer 1st numbers differ - expected: '3', found: '0'