Submission #1081481

#TimeUsernameProblemLanguageResultExecution timeMemory
1081481Wasif_ShahzadLjeto (COCI21_ljeto)C++17
0 / 50
1 ms344 KiB
#include <bits/stdc++.h> using namespace std; #define int int64_t int32_t main(){ #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); #endif int n; cin >> n; vector<int> last(9, -1ll); int sc1 = 0, sc2 = 0; for(int i = 0; i < n; i++){ int t, a, b; cin >> t >> a >> b; if(t - last[a] <= 10 && last[a] != -1){ (a <= 4 ? sc1 += 150 : sc2 += 150); } else{ (a <= 4 ? sc1 += 100 : sc2 += 100); } last[a] = t; } cout << sc1 << " " << sc2 << "\n"; }

Compilation message (stderr)

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