Submission #674711

# Submission time Handle Problem Language Result Execution time Memory
674711 2022-12-26T00:35:16 Z rafatoa Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 320 KB
#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

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 time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 320 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 316 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 1 ms 320 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 316 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 316 KB Output is correct
12 Correct 1 ms 316 KB Output is correct
13 Correct 1 ms 320 KB Output is correct