QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#673606 | #9227. Henry the Plumber | ucup-team191# | WA | 0ms | 3564kb | C++23 | 1.1kb | 2024-10-25 01:39:30 | 2024-10-25 01:39:30 |
Judging History
answer
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
using ll=long long;
using pii=pair<int,int>;
using vi=vector<int>;
using vl=vector<ll>;
#define pb push_back
#define all(a) begin(a),end(a)
const int N=300010,MOD=1e9+7;
const char en='\n';
const ll LLINF=1ll<<60;
int t;
array<int,3> sub(array<int,3> a,array<int,3> b)
{
return {a[0]-b[0],a[1]-b[1],a[2]-b[2]};
}
int dot(array<int,3> a,array<int,3> b)
{
return a[0]*b[0]+a[1]*b[1]+a[2]*b[2];
}
array<int,3> nu;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cin>>t;
while (t--)
{
array<int,3> a1,d1,a2,d2;
for (int i=0;i<3;++i) cin>>a1[i];
for (int i=0;i<2;++i) cin>>d1[i];
d1[2]=0;
for (int i=0;i<3;++i) cin>>a2[i];
for (int i=0;i<2;++i) cin>>d2[i];
d2[2]=0;
if (dot(d1,sub(a2,a1))==0 && dot(d2,sub(a2,a1))==0)
{
cout<<2<<en;
continue;
}
if (dot(d1,d2)*dot(d1,d2)==dot(d1,d1)*dot(d2,d2))
{
cout<<4<<en;
continue;
}
if (dot(d1,sub(a2,a1))<0) d1=sub(nu,d1);
if (dot(d2,sub(a1,a2))<0) d2=sub(nu,d2);
if (dot(d1,d2)>=0) cout<<3<<en;
else cout<<4<<en;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3564kb
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: 3556kb
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 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 3 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 3 4 4 4 4 4 3 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 3 3 4 3 4 4 4 4 4 4 4 4 4
result:
wrong answer 7th numbers differ - expected: '3', found: '4'