Submission #898749

#TimeUsernameProblemLanguageResultExecution timeMemory
898749duckindogLjeto (COCI21_ljeto)C++14
25 / 50
0 ms348 KiB
// from duckindog wth depression #include<bits/stdc++.h> using namespace std; #define int long long const int N = 110; int n; int a[N], b[N], t[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; } } cout << A << ' ' << B << '\n'; }

Compilation message (stderr)

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