#35280: c++


ericshen0922@gmail.com (little coderrr)

學校 : 不指定學校
編號 : 198722
來源 : [59.115.134.90]
最後登入時間 :
2024-04-18 00:18:34
j605. 1. 程式考試 -- 2023年1月APCS | From: [111.243.148.209] | 發表日期 : 2023-05-21 13:09

#include<bits/stdc++.h>

using namespace std;

int main(){

int t;

cin>>t;

int max=-999;

int maxx=0;

int wr=0;

for(int i=0;i<t;++i){

int temp,temp2;

cin>>temp>>temp2;

if(temp2<0){

wr++;

 

}

else{

if(temp2>max){

maxx=temp;

max=temp2;

}

}

}

int ans;

ans=max-t-(wr*2);

if(ans>0){

cout<<ans<<" "<<maxx;

}

else{

cout<<0<<" "<<maxx;

}

 

}

 
ZeroJudge Forum