Submission #494428

#TimeUsernameProblemLanguageResultExecution timeMemory
494428SuckTinHockJob Scheduling (IOI19_job)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define fi first #define se second using namespace std; typedef long long ll; typedef pair<ll,ll> pi; const ll MOD = 1e9 + 7; const double PI = cos(-1); const ll INF = 1e16; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); ll n; struct node { ll p, w, t; }A[200005]; bool cmp(node A, node B) { if (A.p == B.p) { return (double)(A.w / A.t) > (double)(B.w > B.t); } return A.p < B.p; } void xuly() { ll res = 0, pre = 0; sort(A+1,A+n+1,cmp); for (ll i = 1; i <= n; ++i) { pre += A[i].t; res += pre * (A[i].w); } cout << res; } void nhap() { cin >> n; for (ll i = 1; i <= n; ++i) cin >> A[i].p; for (ll i = 1; i <= n; ++i) cin >> A[i].w; for (ll i = 1; i <= n; ++i) cin >> A[i].t; } int main() { ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0); //freopen("IJOB.INP","r",stdin); //freopen("IJOB.OUT","w",stdout); //int T; cin >> T; //while (T--) //{ nhap(); xuly(); //} return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccnVe2xp.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc15aQ2n.o:job.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccnVe2xp.o: in function `main':
grader.cpp:(.text.startup+0x2b1): undefined reference to `scheduling_cost(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status