Submission #1239877

#TimeUsernameProblemLanguageResultExecution timeMemory
1239877JerBikeparking (EGOI24_bikeparking)C++20
0 / 100
0 ms328 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 2; int users[MAXN], slots[MAXN]; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; ++i) scanf("%d", &slots[i]); for (int i = 0; i < n; ++i) scanf("%d", &users[i]); int res = 0; for (int i = 0; i <= min(users[1], slots[0]); ++i) { int rem_slots = slots[0] - i; int rem_users = users[1] - i; int ass = min(users[0], rem_slots); res = max(res, i - max(0, users[0] - ass)); } printf("%d\n", res); return 0; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
Main.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |         scanf("%d", &slots[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~
Main.cpp:16:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |         scanf("%d", &users[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...