BOJ

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

180404_14499_주사위 굴리기

//https://www.acmicpc.net/problem/14499 #include using namespace std;#define east 1#define west 2#define north 3#define south 4 int map[20][20];class dice{public: int U;//up int B;//bottom int E;//east int W;//west int N;//north int S;//south int y; int x; dice(int _U=0, int _B=0, int _E=0, int _W=0, int _N=0, int _S=0): U(_U), B(_B), E(_E), W(_W), N(_N), S(_S) {}};int dy[5]={0, 0, 0, -1, 1};int..

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

180403_2810_컵홀더

//https://www.acmicpc.net/problem/2810#include using namespace std; int main(){ int N; char chair[50]; cin >> N; int ans=1; bool chk=0; for(int i=0; i> chair[i]; if(chair[i]=='S') ans++; if(chair[i]=='L'){ if(!chk) chk=1; else { ans++; chk=0; } } } if(ans

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

180402_13458_시험 감독

//https://www.acmicpc.net/problem/13458 #include using namespace std; int N, B, C; int A[1000000];int main(){ cin >> N; for(int i=0; i> A[i]; cin >> B >> C; long long ans=N;//감독관 무조건 1명 for(int i=0; i

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

180331_12100_2048(easy)

//https://www.acmicpc.net/problem/12100 #include using namespace std;#define UP 0#define DOWN 1#define LEFT 2#define RIGHT 3int mx=0;int N;int board[20][20][2];int cache[6][20][20];void solve(int dir, int depth); int main(){ cin >> N; for(int i=0; i board[i][j][0]; cache[0][i][j]=board[i][j][0]; } for(int i=0; i

bong sue
'BOJ' 태그의 글 목록 (7 Page)