Submission #456459

#TimeUsernameProblemLanguageResultExecution timeMemory
456459Blistering_BarnaclesCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define n1 "\n" using namespace std ; typedef long long ll; typedef long double ld ; const int N=2e7; const ll inf=1e18 ; const ll mod = 1e9+7 ; struct ali { ll x1, y1, x2, y2; ll ar() { return (y2 - y1) * (x2 - x1); } }; ll add(ali p, ali q) { ll fi = max(0ll, min(p.x2, q.x2) - max(p.x1, q.x1)); ll se = max(0ll, min(p.y2, q.y2) - max(p.y1, q.y1)); return fi * se ; } ali add2(ali p, ali q) { ll o = min(p.x2, q.x2) , t = max(p.x1, q.x1) , th = min(p.y2, q.y2) , f = max(p.y1, q.y1) ; ll fi = max(0ll, min(p.x2, q.x2) - max(p.x1, q.x1)); ll se = max(0ll, min(p.y2, q.y2) - max(p.y1, q.y1)); if(fi * se > 0) return {o , th , t , f} ; return { -1 , -1 , -1 , -1} ; } int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); ali one , two , three ; cin >> one.x1 >> one.y1 >> one.x2 >> one.y2 ; cin >> two.x1 >> two.y1 >> two.x2 >> two.y2 ; cin >> three.x1 >> three.y1 >> three.x2 >> three.y2 ; ali e = add2(two , three) ; ll r = add(e , one) ; r = max(r , 0ll) ; ll q = one.ar() + r - add(one , two) - add(one , three) ; //cout << q << endl ; if(q > 0){ cout << "YES" << endl ; } else cout << "NO" << endl ; return 0 ; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccm83Bg7.o: in function `main':
cave.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccO3n6s7.o:grader.c:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccO3n6s7.o: in function `main':
grader.c:(.text.startup+0x10): undefined reference to `exploreCave'
collect2: error: ld returned 1 exit status