QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#402401 | #6812. Draw a triangle | Starrykiller# | WA | 1ms | 3580kb | C++23 | 555b | 2024-04-30 15:10:02 | 2024-04-30 15:10:03 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
int exgcd(int a, int b, int &x, int &y) {
if (!a) return x=1, y=0, a;
int d=exgcd(b,a%b,x,y);
int z=x; x=y, y=z-y*(a/b);
return d;
}
void solve() {
int x1, y1, x2, y2;
cin>>x1>>y1>>x2>>y2;
int x=x2-x1, y=y2-y1;
int a, b;
exgcd(y,x,a,b);
cout<<a<<' '<<b<<'\n';
//
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
int T; cin>>T;
while (T--) solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3580kb
input:
3 1 0 1 4 0 1 0 9 0 0 2 2
output:
0 1 0 1 1 -1
result:
wrong answer wa on query #2 (test case 2)