Bruteforce
-
연구소백준알고리즘 2019. 10. 4. 22:40
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 #include #include #include #include #include #include using namespace std; int map[8][8]; bool d[8][8]; int dx[] = { 0,0,1,-1 }; int dy[] = { 1,-1,0,0 }; int ..
-
2048 (Easy)백준알고리즘 2019. 7. 31. 05:18
#include #include #include #include #include #include using namespace std; int n; int map[21][21]; int temp[21][21]; bool f[21]; int ans = 0; int sum; void move(int dir) { if (dir == 1) {//down for (int i = 0; i = 0; k--) { if (map[k][i] != 0) { if (map[k][i] == map[j]..
-
잉카달력백준알고리즘 2019. 7. 21. 19:41
#include #include #include using namespace std; typedef pair PAIR; int n; PAIR ending; PAIR now; int main(){ scanf("%d", &n); for(int i = 0; i >x>>y; ending.first = x; ending.second = y; int xx,yy; cin>>xx>>yy; now.first = xx; now.second = yy; PAIR comb = make_pair(1,1); int answer = 1; if(now.first == 1 && now.second == 1) answer = 1; else { while (true) { if (comb.firs..
-
리모컨백준알고리즘 2019. 7. 21. 19:39
#include #include #include #include using namespace std; int n; int c; int b[10]; int broken; bool checking(string s){ for(int i = 0; i < s.length(); i++){ for(int j = 0; j < broken; j++){ if(s[i] == to_string(b[j])[0]){ return false; } } } return true; } int length(int c){ if(c / 100000 != 0) return 6; if(c / 10000 != 0) return 5; if(c / 1000 != 0) return 4; if(c / 100 != 0) return 3; if(c / 10..
-
테트로미노백준알고리즘 2019. 7. 21. 03:29
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[][] a = new int[n][m]; for (int i=0; i= 0) { int temp = a[i][j] + a[i+1][j] + a[i+1][j-1] + a[i+2][j-1]; if (ans = 0) { int temp2 = temp + a[i..
-
5658. [모의 SW 역량테스트] 보물상자 비밀번호SWexpertAcademy 2019. 7. 15. 23:27
#include #include #include #include using namespace std; int t; int n, k; int pick[28]; char a[28]; vector result; int zegop(int x) { int r = 1; if (x == 0) return 1; for (int i = 0; i 최대 자릿수 7개 -> 제곱 최대 6개 -> //그냥 편하게함 void vect(int n, int rotate, vector& solv) { for (int i = 0; i < n; i += rotate) { int pp = i % rotate; int sum = 0; for ..