0
0
曹博扬
初级天翼
初级天翼
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,l,t;
struct f{
int x,y;
}a[100005];
int main(){
freopen("soldier.in","r",stdin);
freopen("soldier.out","w",stdout);
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i].x>>a[i].y;
for(int i=1;i<=5;i++){
for(int j=1;j<=n;j++){
int ans=0;
while(a[j].x==i||a[j].y==i){
ans++;
j++;
}
if(ans>l){
l=ans;
t=i;
}
}
}
cout<<l<<" "<<t;
fclose(stdin);
fclose(stdout);
return 0;
}
其实连结构体都不需要 @张皓轩
0
0