Submission #674711

#TimeUsernameProblemLanguageResultExecution timeMemory
674711rafatoaLjeto (COCI21_ljeto)C++17
50 / 50
1 ms320 KiB
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize ("Ofast") #define F first #define S second #define vi vector<int> #define vvi vector<vi> #define pi pair<int, int> #define vpi vector<pi> #define vb vector<bool> #define vvb vector<vb> #define pb push_back #define ppb pop_back #define read(a) for(auto &x:a) cin >> x; #define print(a) for(auto x:a) cout << x << " "; cout << "\n"; #define vc vector<char> #define vvc vector<vc> #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define int long long #define ld long double const int INF = 4e18; void solve(){ int n; cin >> n; vvi v(8); int ans1 = 0, ans2 = 0; for(int i=0; i<n; i++){ int t, a, b; cin >> t >> a >> b; v[a-1].pb(t); } for(int i=0; i<4; i++){ sort(all(v[i])); for(int j=0; j<v[i].size(); j++){ if(j > 0 && v[i][j]-v[i][j-1] <= 10) ans1 += 150; else ans1 += 100; } } for(int i=4; i<8; i++){ sort(all(v[i])); for(int j=0; j<v[i].size(); j++){ if(j > 0 && v[i][j]-v[i][j-1] <= 10) ans2 += 150; else ans2 += 100; } } cout << ans1 << " " << ans2 << "\n"; } signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); // #ifndef ONLINE_JUDGE // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); // #endif int tt = 1; // cin >> tt; while(tt--) solve(); return 0; }

Compilation message (stderr)

Main.cpp: In function 'void solve()':
Main.cpp:37:23: 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 j=0; j<v[i].size(); j++){
      |                      ~^~~~~~~~~~~~
Main.cpp:44:23: 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]
   44 |         for(int j=0; j<v[i].size(); j++){
      |                      ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...