#include<bits/stdc++.h>
#define ll long long
const int nmax = 1e6 + 5, N = 1e6;
const ll oo = 1e9 + 1, base = 311;
const int lg = 19, M = 10;
const ll mod = 1e9 + 2277, mod2 = 1e9 + 5277;
#define pii pair<int, int>
#define fi first
#define se second
#define endl "\n"
#define debug(a, n) for(int i = 1; i <= n; ++i) cout << a[i] << ' '; cout << "\n";
using namespace std;
int n, k;
vector<int> nen;
struct node{
int x1, y1, x2, y2;
}a[nmax];
vector<pii> ans;
bool check(){
}
namespace sub1{
void sol(){
int ma = -oo, ma_2 =-oo;
for(int i = 1; i <= n; ++i){
ma = max(ma, a[i].x1);
ma_2 = max(ma_2, a[i].y1);
}
cout << nen[ma] << ' ' << nen[ma_2];
}
}
namespace sub2{
void sol(){
}
}
namespace sub3{
}
main(){
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
// freopen("code.inp", "r", stdin);
// freopen("code.out", "w", stdout);
cin >> n >> k;
for(int i = 1; i <= n; ++i){
cin >> a[i].x1 >> a[i].y1 >> a[i].x2 >>a[i].y2;
nen.push_back(a[i].x1);
nen.push_back(a[i].y1);
nen.push_back(a[i].x2);
nen.push_back(a[i].y2);
}
sort(nen.begin(), nen.end());
nen.erase(unique(nen.begin(), nen.end()), nen.end());
for(int i = 1; i <= n; ++i){
a[i].x1 = lower_bound(nen.begin(), nen.end(), a[i].x1) - nen.begin();
a[i].y1 = lower_bound(nen.begin(), nen.end(), a[i].y1) - nen.begin();
a[i].x2 = lower_bound(nen.begin(), nen.end(), a[i].x2) - nen.begin();
a[i].y2 = lower_bound(nen.begin(), nen.end(), a[i].y2) - nen.begin();
}
if(k == 1) return sub1::sol(),0;
if(k == 2 ||k == 3) return sub2::sol(), 0;
// sub3::sol();
}
/*
3
1 2 3 4 5 6
7 8 9 10 11
*/
Compilation message
hamburg.cpp: In function 'bool check()':
hamburg.cpp:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
23 | }
| ^
hamburg.cpp: At global scope:
hamburg.cpp:44:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
44 | main(){
| ^~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
3 |
Correct |
2 ms |
416 KB |
Output is correct |
4 |
Correct |
2 ms |
556 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
348 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
348 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
348 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
3 |
Correct |
2 ms |
416 KB |
Output is correct |
4 |
Correct |
2 ms |
556 KB |
Output is correct |
5 |
Correct |
234 ms |
14532 KB |
Output is correct |
6 |
Correct |
223 ms |
14528 KB |
Output is correct |
7 |
Correct |
272 ms |
14484 KB |
Output is correct |
8 |
Correct |
222 ms |
14532 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
348 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
348 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
348 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |