Submission #42566

# Submission time Handle Problem Language Result Execution time Memory
42566 2018-02-28T07:38:53 Z nonocut Adriatic (CEOI13_adriatic) C++14
0 / 100
2000 ms 262144 KB
#include<bits/stdc++.h>
using namespace std;
const int maxv = 2500;
const int maxn = 2.5e5 + 5;
struct node {
	int x,y,id;
};
int n;
node p[maxn];
vector<int> pos[maxv+5];
vector<int> way[maxn];
bool cmp(node a, node b) {
	if(a.x!=b.x) return a.x<b.x;
	return a.y>b.y;
}
int main() {
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d%d",&p[i].x,&p[i].y), p[i].id = i;
	sort(&p[1],&p[n+1],cmp);
	for(int i=1;i<=n;i++) {
        for(int y=1;y<p[i].y;y++) {
            for(auto x : pos[y]) {
                way[p[i].id].push_back(x);
                way[x].push_back(p[i].id);
            }
        }
        pos[p[i].y].push_back(p[i].id);
	}
	//for(int x=1;x<=n;x++) {
    //    for(auto y : way[x]) printf("%d -> %d\n",x,y);
	//}
}

Compilation message

adriatic.cpp: In function 'int main()':
adriatic.cpp:17:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
                ^
adriatic.cpp:18:66: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=1;i<=n;i++) scanf("%d%d",&p[i].x,&p[i].y), p[i].id = i;
                                                                  ^
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 6264 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 7016 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 10972 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2053 ms 262144 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2080 ms 262144 KB Time limit exceeded
2 Halted 0 ms 0 KB -