Submission #974273

#TimeUsernameProblemLanguageResultExecution timeMemory
974273vjudge1Ljeto (COCI21_ljeto)C++17
50 / 50
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int n, t[102], a[102], b[102]; int poinElang = 0, poinBebek = 0; vector <int> elang, bebek; int terakhirElang[12], terakhirBebek[12]; void solve(){ cin >> n; for(int i=1; i<=n; i++){ cin >> t[i] >> a[i] >> b[i]; if(a[i] < b[i]) elang.push_back(i); else bebek.push_back(i); } for(int i=0; i<elang.size(); i++){ int indeks = elang[i]; if(i == 0){ poinElang += 100; terakhirElang[a[indeks]] = t[indeks]; } else { if(terakhirElang[a[indeks]] == 0){ poinElang += 100; terakhirElang[a[indeks]] = t[indeks]; continue; } if(t[indeks]-terakhirElang[a[indeks]] <= 10){ poinElang += 150; terakhirElang[a[indeks]] = t[indeks]; } else { poinElang += 100; terakhirElang[a[indeks]] = t[indeks]; } } } for(int i=0; i<bebek.size(); i++){ int indeks = bebek[i]; if(i == 0){ poinBebek += 100; terakhirBebek[a[indeks]] = t[indeks]; } else { if(terakhirBebek[a[indeks]] == 0){ poinBebek += 100; terakhirBebek[a[indeks]] = t[indeks]; continue; } if(t[indeks]-terakhirBebek[a[indeks]] <= 10){ poinBebek += 150; terakhirBebek[a[indeks]] = t[indeks]; } else { poinBebek += 100; terakhirBebek[a[indeks]] = t[indeks]; } } } cout << poinElang << " " << poinBebek << endl; } int32_t main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); solve(); return 0; }

Compilation message (stderr)

Main.cpp: In function 'void solve()':
Main.cpp:17:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for(int i=0; i<elang.size(); i++){
      |                  ~^~~~~~~~~~~~~
Main.cpp:37:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |     for(int i=0; i<bebek.size(); i++){
      |                  ~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...