180425_1568_새
//https://www.acmicpc.net/problem/1568 #include using namespace std; int main(){ int n; cin >>n; int ans=0; while(1){ for(int i=1; n>=i ; i++){ n-=i; ++ans; } if(n==0) break; } cout
//https://www.acmicpc.net/problem/1568 #include using namespace std; int main(){ int n; cin >>n; int ans=0; while(1){ for(int i=1; n>=i ; i++){ n-=i; ++ans; } if(n==0) break; } cout
//https://www.acmicpc.net/problem/1032 #include #include #include #include using namespace std; struct book{ int idx; int cnt; string title; book(); book(int idx, string title, int cnt) : idx(idx), title(title), cnt(cnt) {}}; bool cmp(book a, book b){ if(a.cnt != b.cnt) return a.cnt> b.cnt; else { if(a.title.compare(b.title) < 0) return true; //사전 순으로 a가 b의 앞일 때 else return false; }}int main(){ ..
//https://www.acmicpc.net/problem/1068 #include #include using namespace std; int tree[50][50];//tree[i][0] : i 번째 노드의 자식 수 //tree[i][j] : i번째 노드의 자식 indexint n, d, ans;void search(int tmp);int main(){ cin >> n; int root; for(int i=0; i> p; if(p==-1) root=i; else{ tree[p][0]++; tree[p][tree[p][0]]=i; } } cin >> d; if(root==d) { cout
//https://www.acmicpc.net/problem/1003 #include using namespace std; int dp[41][2];int main(){ int n; cin >> n; dp[0][0]=1; dp[1][1]=1; for(int i=2; i