Submission #1048618

# Submission time Handle Problem Language Result Execution time Memory
1048618 2024-08-08T08:43:39 Z 우민규(#11036) Bikeparking (EGOI24_bikeparking) C++17
0 / 100
0 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

int n;

void solve() {
    cin >> n;
    int x0, y0, x1, y1;
    cin >> y0 >> y1 >> x0 >> x1;
    int ans = 0;
    for (int x0ty0 = 0; x0ty0 <= 100; ++x0ty0) {
    for (int x1ty0 = 0; x1ty0 <= 100; ++x1ty0) {
        int x0ty1 = x0 - x0ty0;
        int x1ty1 = x1 - x1ty0;
        if (x0ty1 < 0 || x1ty1 < 0) continue;
        if (x0ty0 + x1ty0 > y0) continue;
        if (x0ty1 + x1ty1 > y1) continue;
        ans = max(ans, x1ty0 - x0ty1);
    }
    }
    cout << ans << "\n";
}

int main() {
    cin.tie(0)->sync_with_stdio(0);
    int t = 1;
    solve();
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:26:9: warning: unused variable 't' [-Wunused-variable]
   26 |     int t = 1;
      |         ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -