錯誤訊息:
您的答案為: Case #4: 正確答案為: www.bad.com
這樣為什麼過不了呢?
#include<bits/stdc++.h>
#include<vector>
using namespace std;
int n;
string WebName;
int m,nowappraise=-1,t=0;
vector<string> *Myappraise;
int main(){
while(cin>>n){
Myappraise = new vector<string>[n];
for(int i=0;i<n;++i){
for(int j=0;j<10;++j){
cin>>WebName>>m;
if(m>nowappraise && m<=100 && m>=1){nowappraise = m;Myappraise[i].clear();}
if(nowappraise == m)Myappraise[i].push_back(WebName);
}
}
for(int i=0;i<n;++i){
cout<<"Case #"<<i+1<<":\n";
for(int j=0;j<Myappraise[i].size();++j)cout<<Myappraise[i].at(j)<<'\n';
}
}
return 0;
}
求大神WW
錯誤訊息:
#0: 100% WA (line:15)
您的答案為: Case #4: 正確答案為: www.bad.com
這樣為什麼過不了呢?#include<bits/stdc++.h>
#includeusing namespace std;
int n;
string WebName;
int m,nowappraise=-1,t=0;
vector *Myappraise;int main(){
while(cin>>n){
Myappraise = new vector[n];nowappraise = -1;
for(int i=0;i<n;++i){
for(int j=0;j<10;++j){
cin>>WebName>>m;
if(m>nowappraise && m<=100 && m>=1){nowappraise = m;Myappraise[i].clear();}
if(nowappraise == m)Myappraise[i].push_back(WebName);
}
}
for(int i=0;i<n;++i){
cout<<"Case #"<<i+1<<":\n";
for(int j=0;j<Myappraise[i].size();++j)cout<<Myappraise[i].at(j)<<'\n';
}
}
return 0;
}
求大神WW