내가 작성한 코드

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <vector>
#include <algorithm>
 
using namespace std;
 
int N;
pair <int,int> xy[100000];
 
 
int main() {
 
    cin >> N;
 
    for (int i = 0; i < N; i++) {
        cin >> xy[i].second >> xy[i].first ;
 
    }
 
    sort(xy, xy + N);
 
    for (int i = 0; i < N; i++) {
        // endl 시간 초과
        cout << xy[i].second << ' ' << xy[i].first << '\n';
    }
 
    return 0;
}
cs
  • 이전 좌표 정렬 문제를 그냥 x,y 순서를 바꿔서 입력받아 출력도 반대로 했음
  • 완전 동일한 형태의 코드가 나왔음

코드 채점 결과

 

+ Recent posts