Submission #974275

#TimeUsernameProblemLanguageResultExecution timeMemory
974275vjudge1Ljeto (COCI21_ljeto)C++17
50 / 50
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define all(x) (x).begin(), (x).end() #define fi first #define se second #define pii pair<int,int> #define int long long #define nah_id_win ios_base::sync_with_stdio(0); cin.tie(0) signed main(){ nah_id_win; int n; cin >> n; vector<pair<int, pair<int, int>>> a(n); //{time, {a, b}} for (int i = 0; i < n; i++){ cin >> a[i].fi >> a[i].se.fi >> a[i].se.se; } sort(all(a)); int terakhirLempar[10]; for (int i = 0; i < 10; i++) terakhirLempar[i] = -100; int elang = 0, bebek = 0; for (int i = 0; i < n; i++){ int t = a[i].fi; int lempar = a[i].se.fi, kena = a[i].se.se; if (lempar <= 4) elang += 100; else if (lempar >= 5) bebek += 100; if (t <= terakhirLempar[lempar] + 10){ //cout << "wlee\n"; if (lempar <= 4) elang += 50; else if (lempar >= 5) bebek += 50; } terakhirLempar[lempar] = t; } cout << elang << " " << bebek << "\n"; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:29:28: warning: unused variable 'kena' [-Wunused-variable]
   29 |   int lempar = a[i].se.fi, kena = a[i].se.se;
      |                            ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...