Submission #1168183

#TimeUsernameProblemLanguageResultExecution timeMemory
1168183steveonalexMixture (BOI20_mixture)C++20
0 / 100
0 ms320 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define MASK(i) (1ULL << (i)) #define GETBIT(mask, i) (((mask) >> (i)) & 1) #define ALL(v) (v).begin(), (v).end() ll max(ll a, ll b){return (a > b) ? a : b;} ll min(ll a, ll b){return (a < b) ? a : b;} ll gcd(ll a, ll b){return __gcd(a, b);} ll lcm(ll a, ll b){return a / gcd(a, b) * b;} ll LASTBIT(ll mask){return (mask) & (-mask);} int pop_cnt(ull mask){return __builtin_popcountll(mask);} int ctz(ull mask){return __builtin_ctzll(mask);} int logOf(ull mask){return 63 - __builtin_clzll(mask);} mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); ll rngesus(ll l, ll r){return l + (ull) rng() % (r - l + 1);} double rngesus_d(double l, double r){ double cur = rngesus(0, MASK(60) - 1); cur /= MASK(60) - 1; return l + cur * (r - l); } template <class T1, class T2> bool maximize(T1 &a, T2 b){ if (a < b) {a = b; return true;} return false; } template <class T1, class T2> bool minimize(T1 &a, T2 b){ if (a > b) {a = b; return true;} return false; } template <class T> void printArr(T container, string separator = " ", string finish = "\n", ostream &out = cout){ for(auto item: container) out << item << separator; out << finish; } template <class T> void remove_dup(vector<T> &a){ sort(ALL(a)); a.resize(unique(ALL(a)) - a.begin()); } pair<ll, ll> get_vector(ll x, ll y, ll z, ll a, ll b, ll c){ ll _x = x, _a = a; x *= _a; y *= _a; z *= _a; a *= _x; b *= _x; c *= _x; ll f = y - b, s = z - c; if (f != 0 || s != 0){ ll g = gcd(abs(f), abs(s)); f /= g; s /= g; } return make_pair(f, s); } ll sign(ll x){return (x > 0) - (x < 0);} ll calc(vector<pair<ll, ll>> line){ } void solve(){ ll x, y, z; cin >> x >> y >> z; int n; cin >> n; if (x == 0) assert(false); vector<pair<ll, ll>> dish(1); vector<bool> deactivated(1); for(int i= 1; i <= n; ++i){ char type; cin >> type; if (type == 'A'){ ll a, b, c; cin >> a >> b >> c; pair<ll, ll> p = get_vector(x, y, z, a, b, c); dish.push_back(p); deactivated.push_back(0); } else{ int r; cin >> r; deactivated[r] = 1; } vector<pair<ll, ll>> real; for(int j = 1; j < (int) dish.size(); ++j) if (!deactivated[j]) real.push_back(dish[j]); cout << calc(real) << "\n"; } } int main(void){ ios::sync_with_stdio(0);cin.tie(0); cout.tie(0); clock_t start = clock(); solve(); cerr << "Time elapsed: " << clock() - start << " ms!\n"; return 0; }

Compilation message (stderr)

Mixture.cpp: In function 'll calc(std::vector<std::pair<long long int, long long int> >)':
Mixture.cpp:71:1: warning: no return statement in function returning non-void [-Wreturn-type]
   71 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...