Submission #1186632

#TimeUsernameProblemLanguageResultExecution timeMemory
1186632trantrungkeinLjeto (COCI21_ljeto)C++20
50 / 50
0 ms328 KiB
#include<bits/stdc++.h> #define taskname "A" using namespace std; const int LIM = 1e3 + 5; int n, ans[2], a[LIM], b[LIM]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); if(fopen(taskname".inp", "r")){ freopen(taskname".inp", "r", stdin); } cin >> n; memset(a, ans[0] = ans[1] = 0, sizeof(a)); for(int _ = 0; _ < n; _++){ int t; cin >> t >> a[t] >> b[t]; } for(int i = 1; i < LIM; i++){ if(a[i] != 0){ for(int j = max(1, i - 10); j < i; j++){ if(a[j] == a[i]){ ans[(a[i] - 1) >> 2] += 50; break; } } ans[(a[i] - 1) >> 2] += 100; } } cout << ans[0] << " " << ans[1]; }

Compilation message (stderr)

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