QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#385013 | #3769. 共线点 | ucup-team1251 | WA | 10ms | 3832kb | C++17 | 1.5kb | 2024-04-10 14:42:14 | 2024-04-10 14:42:15 |
Judging History
answer
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <bitset>
#include <cstdio>
#include <string>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <queue>
#include <stack>
#define lowbit(x) x&(-x)
#define pi 3.14159265358
#define lc k<<1;
#define rc k<<1|1
#define ppb push_back
#define mo 1000000007
#define fori(i,l,r) for(int i=l;i<=r;i++)
#define forj(j,l,r) for(int j=l;j<=r;j++)
using namespace std;
typedef long long ll;
typedef unsigned long long ULL;
typedef pair <int, int> pll;
const int N = 2e6 + 10;
const int P = 131;
ll t, n, m;
struct peo{
double a, b, y;
}zz[10];
bool cmp(peo aa, peo bb){
return aa.y < bb.y;
}
void ac(){
while (cin >> zz[1].a>>zz[1].b>>zz[1].y){
cin >> zz[2].a >> zz[2].b >> zz[2].y;
cin >> zz[3].a >> zz[3].b >> zz[3].y;
sort(zz + 1, zz + 1 + 3, cmp);
double l,r;
if (zz[1].a == zz[3].a){
l = zz[1].a;
}
else{
double k = (zz[1].a - zz[3].a) / (zz[1].y - zz[3].y);
double b = zz[1].y - k*zz[1].a;
l = (zz[2].y - b) / k;
}if (zz[1].b == zz[3].b){
r = zz[1].b;
}
else{
double k = (zz[1].b - zz[3].b) / (zz[1].y - zz[3].y);
double b = zz[1].y - k*zz[1].b;
r = zz[2].y - k*zz[2].b;
}if ((zz[2].a >= l&&zz[2].a <= r) || (zz[2].b <= r&&zz[2].a >= l))cout << "Yes\n";
else cout << "No\n";
}
}
int main(){
ios::sync_with_stdio(0);
cin.tie(nullptr);
cout.tie(nullptr);
t = 1;
while (t--){
ac();
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 10ms
memory: 3832kb
input:
0 1 0 0 1 1 0 1 2 0 1 0 1 2 1 0 1 2 0 1 0 2 3 1 0 1 2 3 8 2 5 7 4 2 8 7 2 7 1 1 3 3 0 8 4 4 6 1 1 3 3 2 9 4 0 9 1 0 3 6 2 9 9 0 6 3 4 6 5 1 2 7 6 9 4 4 7 6 1 8 9 0 6 5 0 6 6 0 8 7 4 7 2 6 8 4 2 5 8 5 6 1 6 9 2 1 5 9 3 5 1 2 8 2 3 4 6 5 8 2 1 6 3 8 9 7 1 7 2 4 7 6 2 9 9 5 6 3 0 7 5 2 4 8 0 3 1 2 9 3 ...
output:
Yes Yes No Yes Yes No No No Yes Yes Yes No No No No No No No No No No No No No Yes Yes No No Yes No No No Yes No No No No Yes Yes Yes No Yes Yes Yes No Yes No No Yes Yes No No No Yes No No No Yes Yes No No Yes Yes Yes No Yes No No No No Yes Yes No No Yes No No Yes No Yes No Yes No Yes No No No No Ye...
result:
wrong answer 6th lines differ - expected: 'Yes', found: 'No'