제출 #1369172

#제출 시각아이디문제언어결과실행 시간메모리
1369172ezzzayA String Problem (EGOI25_stringproblem)C++20
50 / 100
85 ms19504 KiB

#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define int long long
const int N=3e5; 
int cnt[N];
int L[N],R[N];
int D,n;
set<int>vc[N];
signed main(){
	cin>>n;
	vector<int>v;
	pair<int,int>mx={0,0};
	for(int i=0;i<n;i++){
		int l,r;
		cin>>l>>r;
		L[i]=l,R[i]=r;
		if((l+r)%2==0)continue;
		cnt[(l+r)%(2*n)]++;
		mx=max(mx,{cnt[(l+r)%(2*n)], (l+r)%(2*n)});
	}
	cout<<n-mx.ff<<endl;
	D=mx.ss;
	for(int i=0;i<n;i++){
		if((L[i]+R[i])%(2*n)==D)continue;
		int r= (2*n+D-L[i])%(2*n);
		cout<<i<<" "<<R[i]<<" "<<r<<endl;
	}
	
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…