| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1367663 | hahaha | A String Problem (EGOI25_stringproblem) | C++20 | 0 ms | 344 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;
int sum[4];
int fr[4];
int p[4];
signed main(){
cin>>n;
int mod=2*n;
for(int i=0; i<n; i++){
int x,y;
cin>>x>>y;
bool go=true;
for(int j=0; j<4&&go; j++)
if((x+y)%mod==sum[j] || sum[j]==0){
if(sum[j]==0) sum[j]=(x+y)%mod;
fr[j]++;
p[j]=i;
go=false;
}
if(y<x) swap(x,y);
pin.pb({x,y});
}
for(int i=0; i<4; i++){
if(fr[i]==n) {cout<<0<<endl; return 0;}
}
int a=-1, b=-1;
for(int i=0; i<4; i++){
if(fr[i]==1){
if(a==-1)a=p[i];
else if(b==-1) b=p[i];
}
}
cout<<2<<endl;
cout<<a<<" "<<pin[a].a<<" "<<pin[b].a<<endl;
cout<<b<<" "<<pin[b].a<<" "<<pin[a].a<<endl;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
