Submission #1176904

#TimeUsernameProblemLanguageResultExecution timeMemory
1176904Hurryup_7735Ljeto (COCI21_ljeto)C++20
25 / 50
0 ms328 KiB
//In The Name Of ALLAH! #pragma GCC optimize("O3") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define ll long long #define ld long double #define endl '\n' #define pb push_back #define pf push_front #define speedyboy ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define bpc __builtin_popcount #define all(x) x.begin() , x.end() #define allr(x) x.rbegin() , x.rend() #define F first #define S second #define pll pair<ll , ll> #define turtle tuple<ll , ll , ll , ll> #define pss pair<string , string> #define YES cout << "YES" << endl; #define NO cout << "NO" << endl; #define ordered_set tree<ll , null_type , less<ll> , rb_tree_tag , tree_order_statistics_node_update> const ll sz = 1e6 + 5 , INF = 1e18 , MOD = 1e9 + 7; ll pos[sz] , x[sz] , y[sz]; ll mask , i , j , o; void solve(){ ll n , team0 = 0 , team1 = 0; cin >> n; for(i = 1 ; i <= n ; i++) cin >> pos[i] >> x[i] >> y[i]; if(1 <= x[1] && x[1] <= 4) team0 += 100; else if(5 <= x[1] && x[1] <= 8) team1 += 100; for(i = 2 ; i <= n ; i++){ if(1 <= x[i] && x[i] <= 4){ team0 += 100; ll j = i - 1; while(j >= 1 && abs(pos[i] - pos[j]) <= 10){ if(x[j] == x[i]) team0 += 50; j--; } } else if(5 <= x[i] && x[i] <= 8){ team1 += 100; ll j = i - 1; while(j >= 1 && abs(pos[i] - pos[j]) <= 10){ if(x[j] == x[i]) team1 += 50; j--; } } } cout << team0 << ' ' << team1 << endl; } signed main(){ speedyboy; //open; ll t = 1; //cin >> t; while(t--){ solve(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...