전체 글
-
5653. [모의 SW 역량테스트] 줄기세포배양SWexpertAcademy 2019. 7. 26. 01:07
#include #include #include #include using namespace std; int dx[] = { 0,0,1,-1 }; int dy[] = { 1,-1,0,0 }; struct node { int x; int y; int time; node(int a, int b, int c) { x = a; y = b; time = c; } }; int tc; int map[800][800]; int n, m, k; int answer; void initial() { for (int i = 0; i < 800; i++) { for (int j = 0; j < 800; j++) { map[i][j] = 0; } } } int main() { scanf("%d", &tc); for (int tn..
-
5644. [모의 SW 역량테스트] 무선 충전SWexpertAcademy 2019. 7. 24. 21:39
#include #include #include #include #include using namespace std; struct bat{ int x; int y; int scale; int charge; int numb; }; int map[8][21][21]; bool d[8][21][21]; int m, a; int tc; int c[5] = { 1, 5, 21, 85, 341}; int dx[] = {1,-1,0,0}; int dy[] = {0,0,1,-1}; int dx1[] = {0,-1,0,1,0}; int dy1[] = {0,0,1,0,-1}; int max(int a, int b){ int max = a; if(max < b) max = b; return max; } bool checki..
-
로또백준알고리즘 2019. 7. 23. 01:32
import java.util.*; public class Main{ public static boolean next_permutation(int[] x){ int i = x.length - 1; while(i > 0 && x[i - 1] = 6) test[i] = 0; else test[i] = 1; } do { for (int i = 0; i < n; i++) { if (test[i] == 1) { System.out.print(set[i] + " "); } } System.out.println(); } while (next_permutation(test)); System.out.println(); } } }
-
일곱난쟁이백준알고리즘 2019. 7. 23. 01:31
#include #include #include using namespace std; int main() { int d[10]; for (int i = 1; i > d[i]; } vector s = { 1,2,3,4,5,6,7,8,9 }; vector result; do { int sum = 0; for (int i = 0; i < 7; i++) { sum += d[s[i]]; } if (sum == 100) { for (int i = 0; i < 7; i++) { result.push_back(d[s[i]]); } break; } } while (next_permutation(s.begin(), s.end())); sort(result.begin(), result.end()); for (int i = ..
-
잉카달력백준알고리즘 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:30
import java.util.Scanner; public class Main { static int k = Integer.MIN_VALUE; static void go(int n,int[] t , int[] p,int day, int pay){ if(day == n ){ if(pay > k) k = pay; return; } if(day > n) return; go(n,t,p,day+t[day], pay+p[day]); go(n,t,p,day + 1 , pay); } public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] t = new int[n]; int[] p = ne..