Submission #68851

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
688512018-08-18 19:11:59dualityBulldozer (JOI17_bulldozer)C++11
100 / 100
1292 ms17128 KiB
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
typedef long long int LLI;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
const double PI = acos(-1.0);
#define x first
#define y second
struct point { int x,y,w; };
bool comp(point a,point b) {
if (a.y == b.y) return a.x > b.x;
else return a.y < b.y;
}
point p[2000];
struct event { int i,j; };
vector<event> events;
LLI cross(event a,event b) {
pii av = mp(p[a.j].x-p[a.i].x,p[a.j].y-p[a.i].y);
pii bv = mp(p[b.j].x-p[b.i].x,p[b.j].y-p[b.i].y);
return (LLI) av.x*bv.y-(LLI) av.y*bv.x;
}
bool comp2(event a,event b) {
LLI c = cross(a,b);
if (c == 0) {
if (a.i == b.i) return a.j < b.j;
else return a.i < b.i;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bulldozer.cpp: In function 'int main()':
bulldozer.cpp:68:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i = 0; i < events.size(); i++) {
                 ~~^~~~~~~~~~~~~~~
bulldozer.cpp:73:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if ((i == events.size()-1) || (cross(events[i],events[i+1]) != 0)) ans = max(ans,vec[0]);
              ~~^~~~~~~~~~~~~~~~~~
bulldozer.cpp:56:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&N);
     ~~~~~^~~~~~~~~
bulldozer.cpp:57:34: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for (i = 0; i < N; i++) scanf("%d %d %d",&p[i].x,&p[i].y,&p[i].w);
                             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...