목록전체 글 (245)
말랑한 하루
[ 핵심풀이 ] [ 핵심소스 ] [ Java ] import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int tc = sc.nextInt(); for(int t=1;t
[ 핵심풀이 ] [ 핵심소스 ] [ C++ ] #include #pragma warning(disable:4996) using namespace std; #define endl "\n" int main() { int tc; cin >> tc; for (int t = 1; t > theta; theta *= 2; int hour = 0, minute = 0; hour = theta / 60; minute = theta % 60; cout
[ 핵심풀이 ] [ 핵심소스 ] [ C++ ] #include #include #pragma warning(disable:4996) using namespace std; #define endl "\n" #define INF 2147483647 #define MAX 100 int block; int obstacle[MAX]; int main() { int tc; cin >> tc; for (int t = 1; t > block; for (int i = 0; i > obstacle[i]; for (int i = 0; i < block - 1; i++) { int stay = obstacle[i] - obstacle[i + 1]; if (stay < 0) high = high..
[ 핵심풀이 ] 1) 순열 조합 2) 0/1 냅색 알고리즘 [ 핵심소스 ] [ C++ ] 1) 순열 조합 #include #include #pragma warning(disable:4996) using namespace std; #define endl "\n" #define MAX 21 int total, max_cal; int high_cal = 0; int high_score = 0; typedef struct data { int score; int cal; }Data; Data food[MAX]; bool visit[MAX]; void solve(int index, int score, int sum_cal) { if (sum_cal > max_cal) return; high_score = high_..
[ 핵심풀이 ] [ 핵심소스 ] [ C++ ] #include #include using namespace std; #define endl "\n" #define tap "\t" #define MAX 27 bool alpha[MAX]; int main() { int tc; cin >> tc; alpha['a' - 'a'] = true; alpha['e' - 'a'] = true; alpha['i' - 'a'] = true; alpha['o' - 'a'] = true; alpha['u' - 'a'] = true; for (int t = 1; t > temp; cout
[ 핵심풀이 ] [ 핵심소스 ] [ C++ ] #include #pragma warning(disable:4996) using namespace std; #define endl "\n" #define MAX 5 int main() { int tc; cin >> tc; for (int t = 1; t > temp; if (temp % 2 == 0) cout
[ 핵심풀이 ] [ 핵심소스 ] [ C++ ] #include #pragma warning(disable:4996) using namespace std; #define endl "\n" #define MAX 5 int result[MAX]; int Div[MAX] = { 2,3,5,7,11 }; void solve(int item) { for (int i = 0; i > tc; for (int i = 1; i > temp; solve(tem..
[ 핵심풀이 ] [ 핵심소스 ] [ C++ ] #include #include #pragma warning(disable:4996) using namespace std; #define endl "\n" int main() { int tc; cin >> tc; for (int t = 1; t > temp; if (temp[0] == '1') cnt++; for (int i = 0; i < temp.length()-1; i++) { if (temp[i] != temp[i + 1]) cnt++; } cout