제출 #1367633

#제출 시각아이디문제언어결과실행 시간메모리
1367633hahahaA String Problem (EGOI25_stringproblem)C++20
14 / 100
75 ms3932 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long 
#define pb push_back
const int N=1e5+1;
struct coord{
    int a;
    int b;
};
vector<coord>pin;
int n;
signed main(){  
    cin>>n; 
    for(int i=0; i<n; i++){
        int x,y; 
        cin>>x>>y;
        if(y<x) swap(x,y);
        pin.pb({x,y});
    } 
    int sum=(2*n +1);
    if(n%2==1){
    cout<<n-1<<endl;
    for(int i=1; i<n; i++){
        cout<<i<<" "<<pin[i].b<<" "<<sum-pin[i].a<<endl;
    }
    }
    else{
        cout<<n-2<<endl;
        for(int i=1; i<n; i++){
            if((pin[i].a+pin[i].b)!=sum) cout<<i<<" "<<pin[i].b<<" "<<(2*n +1)-pin[i].a<<endl;
        }
    }
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…