Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
为什么老是runtime error,帮忙看看#include<iostream> #include<vector> #include<algorithm> #include<string> #include<map> using namespace std; typedef multimap< int,int,less<int> >MID; int main() { int m,n; cin>>m>>n; vector<vector<char> >one(n, vector<char>(m)); for(int i=0;i<n;i++) for(int j=0;j<m;j++) cin>>one[i][j]; int *two=new int(n); for(int i=0;i<n;i++)two[i]=0; for(int k=0;k<n;k++) { for(int i=0;i<m;i++) for(int j=i;j<m;j++) if(one[k][j]<one[k][i])two[k]++;} MID pairs; for(int i=0;i<n;i++) pairs.insert(MID::value_type(two[i],i) ); for(MID::iterator i=pairs.begin();i!=pairs.end();i++){ for(int j=0;j<m;j++)cout<<one[i->second][j]; cout<<endl;} return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator