Skip to content

Commit 3fd5a7f

Browse files
committed
modify nieke code tk2
1 parent 5dce0c9 commit 3fd5a7f

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

.vs/slnx.sqlite

0 Bytes
Binary file not shown.

niuke/daily_problem/25_10-22仰望水面的歪/1.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#include <bits/stdc++.h>
32
using namespace std;
43

@@ -25,10 +24,8 @@ ll gcd3(ll x, ll y, ll z) {
2524
return gcd2(gcd2(x, y), z);
2625
}
2726

28-
2927
int main() {
3028
ios::sync_with_stdio(false), cin.tie(0);
31-
3229
int n, h;
3330
cin >> n >> h;
3431
while (n--) {
@@ -41,14 +38,12 @@ int main() {
4138
//确保x,y和z_img和都是正数,这里题目数据都是正数可以不用llabs
4239
ll g = gcd3(llabs(x), llabs(y), llabs(z_img));
4340

41+
//这里必须要使用ll,使用int会溢出,有6组用例无法通过
4442
ll i = x / g;
4543
ll j = y / g;
4644
ll k = z_img / g;
4745

48-
4946
cout << i << ' ' << j << ' ' << k << '\n';
50-
5147
}
52-
5348
return 0;
5449
}

0 commit comments

Comments
 (0)