알고리즘 문제 풀이/1DP_과제(~180615)
//https://www.acmicpc.net/problem/14646 #include using namespace std;bool menu[100001]; int main(){ int n,x; cin >> n; int cnt=0; int max=0; for(int i=0; i> x; if(menu[x]) cnt--; else { menu[x]=true; cnt++; } if(cnt>max) max=cnt; } cout
알고리즘 문제 풀이/1DP_과제(~180615)
//https://www.acmicpc.net/problem/2010 #include using namespace std; int main(){ int n; cin >> n; int sum=0; for(int i=0; i> x; sum+=x; } cout
알고리즘 문제 풀이/1DP_과제(~180615)
//https://www.acmicpc.net/problem/3986 #include #include #include using namespace std; int main(){ int n; int cnt=0; cin >> n; for(int i=0; i> s; int l=s.size(); stack st; for(int j=0; j
알고리즘 문제 풀이/1DP_과제(~180615)
//https://www.acmicpc.net/problem/5585 #include using namespace std; int main(){ int n,rest; int cnt=0; cin >> n; rest=1000-n; cnt+=rest/500; rest%=500; cnt+=rest/100; rest%=100; cnt+=rest/50; rest%=50; cnt+=rest/10; rest%=10; cnt+=rest/5; rest%=5; cnt+=rest; cout