QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#605655#9227. Henry the Plumberucup-team3215#WA 1ms3604kbC++23865b2024-10-02 18:21:222024-10-02 18:21:24

Judging History

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

  • [2024-10-02 18:21:24]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3604kb
  • [2024-10-02 18:21:22]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define all(x) (x).begin(), (x).end()
using vi = vector<int>;
using pii = array<int, 2>;
using ll = long long;

template<class T>
struct vec {
    T x, y, z;
    using v = vec<T>;
    vec(T x, T y, T z) : x(x), y(y), z(z) {}
    T dot(v b) { return x * b.x + y * b.y + z * b.z; }
};

using vec3d = vec<ll>;

void solve() {
    pii x, y, z, p, q, d;
    for (int i : {0, 1}) {
        cin >> x[i] >> y[i] >> z[i] >> p[i] >> q[i];
        d[i] = -(p[i] * x[i] + q[i] * y[i]);
    }
    bool ans = vec3d(p[0], q[0], 0).dot(vec3d(p[1], q[1], 0)) == 0 ||
                p[0] * x[1] + q[0] * y[1] + d[0] == 0 ||
                p[1] * x[0] + q[1] * y[0] + d[1] == 0;
    cout << (ans ? 3 : 4) << '\n';
}

int main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 1ms
memory: 3540kb

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'