180519_9461_파도반 수열
//https://www.acmicpc.net/problem/9461 #include using namespace std; long long int p[101]; int main(){ p[1]=p[2]=p[3]=1; p[4]=p[5]=2; p[6]=3; p[7]=4; p[8]=5; p[9]=7; p[10]=9; for(int i=11; i> t; while(t-->0){ int n; cin>>n; cout
//https://www.acmicpc.net/problem/9461 #include using namespace std; long long int p[101]; int main(){ p[1]=p[2]=p[3]=1; p[4]=p[5]=2; p[6]=3; p[7]=4; p[8]=5; p[9]=7; p[10]=9; for(int i=11; i> t; while(t-->0){ int n; cin>>n; cout
//https://www.acmicpc.net/problem/4597 #include #include using namespace std; int main(){ while(true){ string s; cin>>s; if(s[0]=='#') return 0; int l=s.size(); int one=0; bool mode=0; for(int i=0; i
//https://www.acmicpc.net/problem/14623 #include #include using namespace std; int main(){ string b1,b2; cin >> b1 >> b2; int l1=b1.size(); int l2=b2.size(); int ans[64]={0,}; int digit=1; int length; for(int i=l2-1; i>=0; --i){ int idx=1*digit; for(int j=l1-1; j>=0; --j){ ans[idx++]+=(b1[j]-'0')*(b2[i]-'0'); } ++digit; length=idx; } for(int i=1; i=2){ ans[i+1]+=(ans[i]/2); ans[i]%=2; } } for(in..
//https://www.acmicpc.net/problem/2751 #include using namespace std; int arr[1000001];int n; void partition(int left, int right){ if(left==right) return; else if(left+1==right){ //한 칸 차이 일 때, 정렬 if(arr[left]>arr[right]){ int tmp=arr[left]; arr[left]=arr[right]; arr[right]=tmp; } return; } int mid=(left+right)/2; partition(left, mid); partition(mid+1, right); //분할 int *sortedarr = new int[right-l..