QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#639757#9227. Henry the PlumberpropaneWA 0ms3636kbC++201.4kb2024-10-13 22:14:392024-10-13 22:14:39

Judging History

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

  • [2024-10-13 22:14:39]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3636kb
  • [2024-10-13 22:14:39]
  • 提交

answer

#include<iostream>
#include<cstring>
#include<vector>
using namespace std;
using LL = long long;

struct P2{
    int x, y;

    int operator*(const P2 &t) const {
        return x * t.x + y * t.y;
    }

    int operator^(const P2 &t) const {
        return x * t.y - y * t.x;
    }

    P2 operator-(const P2 &t) const {
        return {x - t.x, y - t.y};
    }

};

int main(){

#ifdef LOCAL
    freopen("data.in", "r", stdin);
    freopen("data.out", "w", stdout);
#endif

    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(0);

    int T;
    cin >> T;
    while(T--){
        P2 p1, p2;
        int z1, z2;
        P2 d1, d2;
        cin >> p1.x >> p1.y >> z1;
        cin >> d1.x >> d1.y;
        cin >> p2.x >> p2.y >> z2;
        cin >> d2.x >> d2.y;
        if (z1 == z2){
            if ((d1 ^ d2) == 0 and (p2 - p1) * d1 == 0){
                cout << 2 << '\n';
                continue;
            }   
            if (d1 * d2 == 0){
                cout << 3 << '\n';
                continue;
            }
            cout << 4 << '\n';
            continue;
        }
        if (p1.x == p2.x and p1.y == p2.y){
            cout << 2 << '\n';
            continue;
        }
        if ((p2 - p1) * d1 == 0 or (p2 - p1) * d2 == 0){
            cout << 3 << '\n';
            continue;
        }
        cout << 4 << '\n';
    }

}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3580kb

input:

2
-1 -1 3
1 1
2 2 3
2 2
5 5 1
3 0
7 6 -2
1 -2

output:

4
3

result:

ok 2 number(s): "4 3"

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3636kb

input:

100
-13 -5 -7
-19 19
-19 -13 0
-7 15
-20 20 19
-17 18
20 -20 -1
18 -19
-18 15 -14
-19 18
19 -20 6
20 -19
-12 9 1
7 -16
-13 -14 -8
8 -13
-19 16 9
20 -19
19 -18 -11
19 -18
19 20 -8
12 20
-11 -9 18
-19 -18
8 11 -13
12 -18
18 13 8
4 -18
-16 20 17
-19 18
20 -18 -3
20 -19
-17 -20 -5
-18 -19
19 16 15
19 20...

output:

4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
3
4
4
4
4
4
4
4
4
4
4
4

result:

wrong answer 7th numbers differ - expected: '3', found: '4'