분류 전체보기

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

180522_4963_섬의 개수

//https://www.acmicpc.net/problem/4963 #include #include #include using namespace std; bool map[50][50];bool visited[50][50];int cnt;int w, h;int dy[8]={-1, -1, -1, 0, 0, 1, 1, 1};int dx[8]={-1, 0, 1, -1, 1, -1, 0, 1};void bfs(int y, int x){ queue q; q.push(make_pair(y,x)); map[y][x]=0; int nowy; int nowx; while(!q.empty()){ nowy=q.front().first; nowx=q.front().second; q.pop(); for(int i=0; i> w..

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

180521_9012_괄호

//https://www.acmicpc.net/problem/9012 #include #include #include using namespace std; bool vps(){ stack s; string str; cin >>str; int l=str.size(); s.push(str[0]); for(int i=1; i> tc; for(int i=0; i

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

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

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

180518_4597_패리티

//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

bong sue
'분류 전체보기' 카테고리의 글 목록 (8 Page)