#include <iostream>
using namespace std;
int main()
{
int n = 0;
cin >> n;
int t[1000] = {0};
int s[1000] = {0};
int wrong, time = 0;
int maximun = -1;
//input array
for(int i = 0; i<n; i++){
cin >> t[i];
cin >> s[i];
}
//count wrong
for(int i = 0; i<n; i++){
if(s[i] == -1){
wrong++;
}
}
//maximun
for(int i = 0; i<n; i++){
if(s[i] > maximun){
maximun = s[i];
time = i;
}
}
int point = maximun - n - (wrong * 2);
if(point >= 0){
cout << point << " ";
}else{
cout << 0 << " ";
}
cout << t[time];
return 0;
}
#include
using namespace std;
int main()
{
int n = 0;
cin >> n;int t[1000] = {0};
int s[1000] = {0};int wrong, time = 0;
int maximun = -1;//input array
for(int i = 0; i
cin >> t[i];
cin >> s[i];
}//count wrong
for(int i = 0; i
if(s[i] == -1){
wrong++;
}
}//maximun
for(int i = 0; i
if(s[i] > maximun){
maximun = s[i];
time = i;
}
}int point = maximun - n - (wrong * 2);
if(point >= 0){
cout << point << " ";
}else{
cout << 0 << " ";
}cout << t[time];
return 0;
}
wrong 沒給初始值