Submission #906290

#TimeUsernameProblemLanguageResultExecution timeMemory
906290vjudge1Job Scheduling (IOI19_job)C++17
5 / 100
46 ms8496 KiB
#include "job.h" #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define endl '\n' #define K first #define V second using namespace std; using namespace __gnu_pbds; template<typename T> ostream_iterator<T> oit(const string &s = " "){ return ostream_iterator<T>(cout,s.c_str()); } struct chash { static uint64_t splitmix64(uint64_t x) { // http://xorshift.di.unimi.it/splitmix64.c x += 0x9e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; x = (x ^ (x >> 27)) * 0x94d049bb133111eb; return x ^ (x >> 31); } size_t operator()(uint64_t x) const { static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count(); return splitmix64(x + FIXED_RANDOM); } }; template<typename T, typename U> using pb_map = gp_hash_table<T, U, chash>; template<typename T> using pb_set = gp_hash_table<T, null_type, chash>; typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<vector<int>> vii; typedef vector<ll> vll; typedef pair<ll,ll> pll; typedef pair<int,int> pii; constexpr ll NN = 2e5; constexpr ll M = 1000000007; long long scheduling_cost(std::vector<int> p, std::vector<int> u, std::vector<int> d) { ll ans = 0; int n = (int)p.size(); bool case1 = true; for(int i=1;i<n;i++){ case1 &= p[i]==i-1; } if(case1){ ll time = 0; for(int i=0;i<n;i++){ time += d[i]; ans += time*u[i]; } return ans; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...