알고리즘 문제 풀이

알고리즘 문제 풀이/1DP_과제(~180615)

180505_6679_싱기한 네자리 숫자

//https://www.acmicpc.net/problem/6679 #include using namespace std; int main(){ for(int i=1000; i0){ a+=tmp%10; tmp/=10; } tmp=i; while(tmp>0){ b+=tmp%12; tmp/=12; } if(a!=b) continue; tmp=i; b=0; while(tmp>0){ b+=tmp%16; tmp/=16; } if(a!=b) continue; cout

알고리즘 문제 풀이/1DP_과제(~180615)

180504_2751_수 정렬하기 2 (퀵정렬)

//https://www.acmicpc.net/problem/2751 #include using namespace std; int arr[1000001];int n;void swap(int a, int b){ int tmp=arr[a]; arr[a]=arr[b]; arr[b]=tmp; return;}int partition(int low, int high){ int pivotidx=low+(high-low)/2; int pivotval=arr[pivotidx]; swap(pivotidx, high);//pivot을 오른쪽으로 보내줌 int stridx=low; for(int i=low; i arr[i]; quick_sort(0,n-1); for(int i=0; i

알고리즘 문제 풀이/1DP_과제(~180615)

180503_3460_이진수

//https://www.acmicpc.net/problem/3460 #include using namespace std; int main(){ int t; cin >> t; while(t-->0){ int n; cin >> n; for(int i=0; ;i++){ if(n%2) cout

알고리즘 문제 풀이/1DP_과제(~180615)

180502_2576_홀수

//https://www.acmicpc.net/problem/2576 #include using namespace std; int main(){ int num[7]; int sum=0; int mn=101; for(int i=0; i> num[i]; if(num[i]%2) { sum+=num[i]; if(num[i]

bong sue
'알고리즘 문제 풀이' 카테고리의 글 목록 (9 Page)