본문 바로가기

반응형

Algorithm_BOJ(백준)/수학(Math)

(27)
[백준 1934 c++ O] 최소공배수 - 풀이 링크: https://github.com/xhaktmchl/Algorithm_study/blob/main/BOJ/%EC%88%98%ED%95%99(Math)/%5B%EB%B0%B1%EC%A4%80%201934%20c%2B%2B%20O%5D%20%EC%B5%9C%EC%86%8C%EA%B3%B5%EB%B0%B0%EC%88%98.cpp GitHub - xhaktmchl/Algorithm_study: 알고리즘 이론 및 문제풀이 알고리즘 이론 및 문제풀이. Contribute to xhaktmchl/Algorithm_study development by creating an account on GitHub. github.com #include #include // fill_n, min,max, swap ..
[백준 10610 c++ V] 30 - 풀이 링크: https://github.com/xhaktmchl/Algorithm_study/blob/main/BOJ/%EC%88%98%ED%95%99(Math)/%5B%EB%B0%B1%EC%A4%80%2010610%20c%2B%2B%20V%5D%2030.cpp GitHub - xhaktmchl/Algorithm_study: 알고리즘 이론 및 문제풀이 알고리즘 이론 및 문제풀이. Contribute to xhaktmchl/Algorithm_study development by creating an account on GitHub. github.com #include #include //#include // 중복 x #include // getline #include using namespace std..
[백준 1735 c++ O] 분수 합 - 풀이 링크: https://github.com/xhaktmchl/Algorithm_study/blob/main/BOJ/%EC%88%98%ED%95%99(Math)/%5B%EB%B0%B1%EC%A4%80%201735%20c%2B%2B%20O%5D%20%EB%B6%84%EC%88%98%20%ED%95%A9.cpp GitHub - xhaktmchl/Algorithm_study: 알고리즘 이론 및 문제풀이 알고리즘 이론 및 문제풀이. Contribute to xhaktmchl/Algorithm_study development by creating an account on GitHub. github.com #include #include //#include // 중복 x //#include // getline..
[백준 10430 c++ OO] 나머지 1234567891011121314151617181920212223242526#define _CRT_SECURE_NO_WARNINGS#include #include #include using namespace std;/*[백준 10430 c++ OO] 나머지문제:주어진 식을 계산접근: 시간복잡도:풀이:*/int a, b, c; int main() { ios::sync_with_stdio(false); // 계산시간 단축 // cin,scanf 같이 쓰면 오류 cin.tie(nullptr); cout.tie(nullptr);// 입출력 시간 단축 // 이것을 쓰면 scanf,printf섞어 쓰면 안됨 cin >> a >> b >> c; cout
[백준 5543 c++ O] 상근날드 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 #define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include // memset 헤더 using namespace std; // [백준 5543 c++ O] 상근날드 // 문제: // 접근1: // 시간복잡도: // 풀이: #define MAX 3 int bg[MAX]; int drink[2]; int minN = 4000; int main() { ios::sync_with_stdio(false); // 계산시간 단축 // cin,scanf 같이 쓰면..
[백준 2587 c++ O] 대표값2 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 #define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include // memset 헤더 using namespace std; // [백준 2587 c++ O] 대표값2 // 문제: // 접근1: // 시간복잡도: // 풀이: vector a; int sum = 0; int main() { ios::sync_with_stdio(false); // 계산시간 단축 // cin,scanf 같이 쓰면 오류 cin.tie(nullptr); cout.tie(nullptr);// 입출력 시간 단축 ..
[백준 2592 c++ O] 대표값 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 #define _CRT_SECURE_NO_WARNINGS #include #include #include #include // memset 헤더 using namespace std; // [백준 2592 c++ O] 대표값 // 문제: // 접근: // 시간복잡도: // 풀이: // 평균은 직접 구함 // 최빈값은 갯수 벡터에 카운트 #define MAX 1001 int n, sum = 0; vector cnt(MAX); int main() { ios::sync_with_stdio(false); // 계산시간 단축 // cin,scanf 같이 쓰면 오류 c..
[백준 2921 c++ O] 도미노 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #define _CRT_SECURE_NO_WARNINGS #include #include #include #include // memset 헤더 using namespace std; // [백준 2921 c++ O] 도미노 // 문제: // 접근: // 풀이: int n,sum=0; int main() { ios::sync_with_stdio(false); // 계산시간 단축 // cin,scanf 같이 쓰면 오류 cin.tie(nullptr); cout.tie(nullptr);// 입출력 시간 단축 // 이것을 쓰면 scanf,printf섞어 쓰면 안됨 cin >> n; for (int i = 1; i

반응형