QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#402401#6812. Draw a triangleStarrykiller#WA 1ms3580kbC++23555b2024-04-30 15:10:022024-04-30 15:10:03

Judging History

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

  • [2024-04-30 15:10:03]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3580kb
  • [2024-04-30 15:10:02]
  • 提交

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)