Submission #898771

#TimeUsernameProblemLanguageResultExecution timeMemory
898771duckindogLjeto (COCI21_ljeto)C++14
50 / 50
0 ms348 KiB
// from duckindog wth depression #include<bits/stdc++.h> using namespace std; const int N = 110; int n; int t[N], a[N], b[N]; int32_t main() { cin.tie(0)->sync_with_stdio(0); if (fopen("duck.inp", "r")) { freopen("duck.inp", "r", stdin); freopen("duck.out", "w", stdout); } cin >> n; for (int i = 1; i <= n; ++i) cin >> t[i] >> a[i] >> b[i]; int A = 0, B = 0; for (int i = 1; i <= n; ++i) { int &ret = a[i] <= 4 ? A : B; ret += 100; for (int j = i - 1; j >= 1; --j) { if (t[i] - t[j] > 10) break; if (a[i] == a[j]) { ret += 50; break; } } } cout << A << ' ' << B << '\n'; }

Compilation message (stderr)

Main.cpp: In function 'int32_t main()':
Main.cpp:14:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     freopen("duck.inp", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:15:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |     freopen("duck.out", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...