题解:「NLOI Round1」白鸟过河滩
Wyh_dailyAC · · 题解
前言
题目名好评。
题意
给定数
输出
Sol
把三个数通分为
在这种做法中,注意开 __int128。
Code
::::success[Code]{open}
#include <bits/stdc++.h>
#define sfr return cerr << "safe\n", 0;
#define sf_void return cerr << "safe\n", void();
using namespace std;
using ll = long long;
using i128 = __int128;
using pr = pair<int, int>;
using prt = tuple<int, int>;
using tpt = tuple<int, int, int>;
i128 read() {
char c = getchar_unlocked();
i128 ret = 0, f = 1;
while (!isdigit(c)) { f = (c == '-' ? -1 : f), c = getchar_unlocked(); }
while (isdigit(c)) { (ret *= 10) += c - '0', c = getchar_unlocked(); }
return ret * f;
}
auto main() -> signed {
ios::sync_with_stdio(false);
cin.tie(nullptr), cout.tie(nullptr);
i128 T = read();
while (T--) {
i128 a = read(), b = read(), c = read(), x = read(), y = read(), z = read();
a *= y * z, b *= x * z, c *= x * y;
auto t = max({a, b, c});
if (t == a) cout << "1\n";
else if (t == b) cout << "2\n";
else cout << "3\n";
}
}
::::