Submission #650961

# Submission time Handle Problem Language Result Execution time Memory
650961 2022-10-16T08:28:50 Z ktkerem Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 212 KB
/*#pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")/**/
#include<bits/stdc++.h>
/**/
//typedef int ll;
typedef long long ll;
typedef unsigned long long ull;
/*typedef __int128 vll;
typedef unsigned __int128 uvll;*/
#define llll std::pair<ll , ll>
#define pb push_back
#define pf push_front
#define halo cout << "hello\n"
#define fi first
#define sec second
#define all(a) a.begin() , a.end()
const ll limit = 1e15+7; 
const ll ous = 2e5 + 7;
const ll dx[4] = {-1 , 0 , 1 , 0} , dy[4] = {0,1,0,-1};
std::vector<llll> ar[10];
std::vector<ll> tm(10);
ll n;
void solve(){
    std::cin >> n;
    for(ll i = 0;10>i;i++){
        ar[i].clear();
    }
    for(ll i = 0;n>i;i++){
        ll x , y , z;std::cin >> x >> y >> z;
        ar[y].pb({x , z});
    }
    for(ll i = 1;4>=i;i++){
        tm[i] = 0;
        tm[i + 4] = 1;
    }
    ll bp = 0 , pp = 0;
    for(ll i = 1;8>=i;i++){
        std::sort(all(ar[i]));
        ll kd = 1;
        ll s = 0;
        for(auto j:ar[i]){
            //std::cout << j.fi << " " << j.sec << "\n";
            if(s != 0 && kd == 1 && tm[i] != tm[j.sec] && ar[i][s-1].fi + 10 >= j.fi){
                if(i <= 4){
                    bp+=150;
                }
                else{
                    pp+=150;
                }
            }
            else if(tm[i] != tm[j.sec]){
                kd = 1;
                if(i <= 4){
                    bp+=100;
                }
                else{
                    pp+=100;
                }   
            }
            else{
                kd = 0;
            }
            s++;
        }
    }
    std::cout << bp << " " << pp << "\n";
    return;/**/
}
signed main(){
    std::ios_base::sync_with_stdio(false);std::cin.tie(NULL);
    ll t=1;
    //std::cin >> t;
    ll o = 1;
    while(t--){ 
        //cout << "Case " << o++ << ":\n";
        solve();
    }
    return 0;
}

Compilation message

Main.cpp:5:78: warning: "/*" within comment [-Wcomment]
    5 | #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")/**/
      |                                                                               
Main.cpp: In function 'int main()':
Main.cpp:76:8: warning: unused variable 'o' [-Wunused-variable]
   76 |     ll o = 1;
      |        ^
# 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 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 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 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct