Submission #1077117

#TimeUsernameProblemLanguageResultExecution timeMemory
1077117shiroboyyLjeto (COCI21_ljeto)C++14
50 / 50
1 ms348 KiB
#include <bits/stdc++.h> #define mp make_pair #define pb push_back #define endl "\n" #define fi first #define se second #define SZ(x) (x).size() #define ALL(x) (x).begin(), (x).end() #define BIT(x, i) (((x) >> (i)) & 1) #define MASK(x) (1LL << (x)) #define rep(i, l, r) for (int i = (l), _r = (r); i <= _r; i++) #define rev(i, r, l) for (int i = (r), _l = (l); i >= _l; i--) using namespace std; typedef vector<int> vi; typedef pair<int, int> pi; typedef long long ll; typedef unsigned long long ull; typedef long double ld; template<class X, class Y> inline bool maximize(X &x, const Y &y) {return x < y ? x = y, 1 : 0;} template<class X, class Y> inline bool minimize(X &x, const Y &y) {return x > y ? x = y, 1 : 0;} const int MAX = 2e5 + 7; const int INF = 1e9 + 7; const int MOD = 1e9 + 7; int last[9]; void solve() { int n; cin >> n; int score_a = 0, score_b = 0; rep(i, 1, n) { int t, a, b; cin >> t >> a >> b; if (a <= 4) score_a += 100; if (a >= 5) score_b += 100; if (t - last[a] <= 10 && i > 1) { if (a <= 4) score_a += 50; if (a >= 5) score_b += 50; } last[a] = t; cerr << score_a << " " << score_b << endl; } cout << score_a << " " << score_b << endl; } int32_t main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define task "ljeto" if (fopen(task".inp", "r")) { freopen(task".inp", "r", stdin); freopen(task".out", "w", stdout); } int test_case = 1; //cin >> test_case; while (test_case--) { solve(); } cerr << "\nTime elapsed: " << clock() * 1.0 / CLOCKS_PER_SEC << " seconds" << endl; }

Compilation message (stderr)

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