백준 정렬 모음집 - 2
·
코딩/C++
백준 11557번 - Bronze I #include #include #include #include using namespace std; bool compare(paira, pairb){ return a.second>b.second; } int main(void) { pairuni; vectorvc; int tc; cin>>tc; for(int i=0;i>n; for(int j=0;j>uni.first>>uni.second; vc.push_back(uni); } sort(vc.begin(), vc.end(),compare); cout
백준 정렬 모음집 - 1
·
코딩/C++
각 파트별로 좀 여러 문제를 많이 풀 필요성을 느낌! 백준 1427번 - Silver V #include #include using namespace std; int main(void) { string str; cin>>str; sort(str.begin(),str.end(),greater());//내림차순 cout n; vector vc(n,vector(2,0)); //n행 2열 0으로 초기화 for(int i=0;i>vc[i][0]; cin>>vc[i][1]; } sort(vc.begin(), vc.end());// 오름차순 정렬 for(int i=0;i
TaffyMuffin
'정렬' 태그의 글 목록