Submission #1275365

#TimeUsernameProblemLanguageResultExecution timeMemory
1275365chanhchuong123Ljeto (COCI21_ljeto)C++20
50 / 50
1 ms576 KiB
#include<bits/stdc++.h> using namespace std; const bool multiTest = false; #define task "C" #define fi first #define se second #define MASK(i) (1LL << (i)) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define BIT(mask, i) ((mask) >> (i) & 1) template<typename T1, typename T2> bool minimize(T1 &a, T2 b) { if (a > b) a = b; else return 0; return 1; } template<typename T1, typename T2> bool maximize(T1 &a, T2 b) { if (a < b) a = b; else return 0; return 1; } void process(void) { int n; cin >> n; int scoreA = 0; int scoreB = 0; vector<int> last(10, -20); while (n--) { int t, a, b; cin >> t >> a >> b; if (a <= 4) { if (last[a] + 10 >= t) scoreA += 50; scoreA += 100; } else { if (last[a] + 10 >= t) scoreB += 50; scoreB += 100; } last[a] = t; } cout << scoreA << ' ' << scoreB << '\n'; } int main(void) { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); if (fopen(task".inp", "r")) { freopen(task".inp", "r", stdin); freopen(task".out", "w", stdout); } int nTest = 1; if (multiTest) cin >> nTest; while (nTest--) { process(); } return 0; }

Compilation message (stderr)

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