답안 #681782

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
681782 2023-01-14T09:36:57 Z Cross_Ratio Izvanzemaljci (COI21_izvanzemaljci) C++14
5 / 100
23 ms 3840 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e18;
array<int, 2> A[100005];
void subtask_1(int N) {
    int mx = -INF, ix = INF, my = -INF, iy = INF;
    int i, j;
    for(i=0;i<N;i++) {
        mx = max(mx, A[i][0]);
        ix = min(ix, A[i][0]);
        my = max(my, A[i][1]);
        iy = min(iy, A[i][1]);
    }
    cout << ix << ' ' << iy << ' ' << max(mx - ix, my - iy);
}
void subtask_2(int N) {

}
void subtask_3(int N) {

}
signed main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int N, K;
    cin >> N >> K;
    int i, j;
    for(i=0;i<N;i++) cin >> A[i][0] >> A[i][1];
    if(N==1) {
        cout << A[0][0] << ' ' << A[0][1] << ' ' << 1 << '\n';
        if(K>=2) cout << 1e9 + 2 << ' ' << 1e9 + 2 << ' ' << 1 << '\n';
        if(K>=3) cout << 1e9 + 4 << ' ' << 1e9 + 4 << ' ' << 1 <<'\n';
        return 0;
    }
    if(K==1) {
        subtask_1(N);
    }
    if(K==2) {
        subtask_2(N);
    }
    if(K==3) {
        subtask_3(N);
    }
}

Compilation message

izvanzemaljci.cpp: In function 'void subtask_1(long long int)':
izvanzemaljci.cpp:8:12: warning: unused variable 'j' [-Wunused-variable]
    8 |     int i, j;
      |            ^
izvanzemaljci.cpp: In function 'int main()':
izvanzemaljci.cpp:29:12: warning: unused variable 'j' [-Wunused-variable]
   29 |     int i, j;
      |            ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 22 ms 3788 KB Output is correct
8 Correct 22 ms 3816 KB Output is correct
9 Correct 21 ms 3820 KB Output is correct
10 Correct 21 ms 3840 KB Output is correct
11 Correct 23 ms 3788 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Expected integer, but "1e+09" found
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Expected integer, but "1e+09" found
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 340 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 340 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -