70862023-12-30 10:01:31MagyarKendeSZLGSakktábla (75 pont)cpp17Accepted 75/753ms3868 KiB
#include <bits/stdc++.h>

#define speed cin.tie(0); ios::sync_with_stdio(0)
#define cinv(v) for (auto& e : v) cin >> e;
#define all(v) v.begin(), v.end()
#define has(s, e) s.count(e)

using namespace std;
using ll = long long;
using point = array<int, 2>;

int main() {
    speed;

    int N, M;
    cin >> N >> M;
    int K = min(sqrt(N * 2), sqrt(M * 2)),
        db = pow(K, 2) / 2;
    N -= db, M -= db;
    cout << (K += (N >= K + 1 && M >= K) || (M >= K + 1 && N >= K));
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1892 KiB
2Accepted0/03ms2116 KiB
3Accepted5/53ms2480 KiB
4Accepted5/53ms2388 KiB
5Accepted5/53ms2580 KiB
6Accepted5/53ms2664 KiB
7Accepted5/53ms2796 KiB
8Accepted5/53ms3004 KiB
9Accepted5/53ms3256 KiB
10Accepted5/53ms3176 KiB
11Accepted7/73ms3216 KiB
12Accepted7/73ms3316 KiB
13Accepted7/73ms3540 KiB
14Accepted7/73ms3660 KiB
15Accepted7/73ms3868 KiB