알고리즘 문제 풀이/1DP_과제(~180615)
2018.06.08
//https://www.acmicpc.net/problem/1076 #include #include #include using namespace std; struct res{ string color; int value; long long int digit;}; res table[10]; void maketable(){ table[0].color="black"; table[0].value=0; table[0].digit=1; table[1].color="brown"; table[1].value=1; table[1].digit=10; table[2].color="red"; table[2].value=2; table[2].digit=100; table[3].color="orange"; table[3].val..
알고리즘 문제 풀이/1DP_과제(~180615)
2018.06.07
//https://www.acmicpc.net/problem/5597 #include using namespace std; int max(int a, int b) { return a>b ? a : b;}int min(int a, int b) { return a x; chk[x]=1; } int ans1=0, ans2=0; for(int i=1; i
알고리즘 문제 풀이/1DP_과제(~180615)
2018.06.04
//https://www.acmicpc.net/problem/10769 #include using namespace std; int main(){ char str[256]; cin.getline(str, 255); int cnt[2]={0,0}; for(int i=0; str[i]!=0; i++){ if(str[i]==':' && (str[i+1]!=0 && str[i+2]!=0)){ if(str[i+1]=='-'){ if(str[i+2]==')') cnt[0]++; else if(str[i+2]=='(') cnt[1]++; } } } if(cnt[1]==0 && cnt[0]==0) cout cnt[1]) cout
알고리즘 문제 풀이/1DP_과제(~180615)
2018.06.02
//https://www.acmicpc.net/problem/4690#include using namespace std; int main(){ int a,b,c,d; for(a=2; a