일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 스택
- 그래프
- 컴퓨터공학과
- 컴공
- 문제풀이
- 백준
- Stack
- 구현
- 오퍼레이팅시스템
- 컴공과
- coding
- DP
- 정석
- 자료구조
- 너비우선탐색
- 북리뷰
- Operating System
- OS
- Computer science
- vector
- 정석학술정보관
- 코딩
- c++
- 개발
- 오에스
- 알고리즘
- 브루트포스
- cs
- 코테
- bfs
- Today
- Total
목록백준 (160)
Little Jay
#include #include #include using namespace std; int main() { ios::sync_with_stdio(false); int testCase; cin >> testCase; deque dq; for (int i = 0; i > s; if (s == "push_front") { int num; cin >> num; dq.push_front(num); } else if (s == "push_back") { int num; cin >> num; dq.push_back(num); } else if (s == "pop_front") { if (dq.empty()) { cout
일반적으로 벡터나 배열에 숫자를 저장하게 된다면 문제의 조건에서 주어진 메모리값을 초과한다. 그래서 숫자를 받고, 그 값을 카운트해서 그 값을 출력해주면 됨. 입력될 수 있는 수가 10,000,000개라서 이걸 배열이나 벡터에 저장해버리면 당연히 메모리에러가 발생한다. #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; int arr[10001]{ 0, }; for (int i = 0; i > a; arr[a]++; } for (int i = 0; i
처음에 이 문제를 봤을때 진짜 queue만 써서 구하는 문제는 아니겠지...?라는 마음으로 접근했는데, queue 자체의 기능을 써도 되는 것 같고, 구조체를 써도 되는 것 같았다. 하지만 구조체를 하직 배우지 않아서 queue를 사용하는 방향으로 문제를 풀었다. #include #include #include using namespace std; int main() { ios::sync_with_stdio(false); int testCase; cin >> testCase; queue q; for (int i = 0; i > s; if (s == "push") { int n; cin >> n; q.push(n); } else if (s == ..
#include using namespace std; int main() { int testCase; cin >> testCase; int apt[15][15]{ 0, }; for (int i = 0; i row >> col; cout
#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int a, b, c; while (true) { cin >> a >> b >> c; if (a == 0 && b == 0 && c == 0) break; else { if (a * a + b * b == c * c || a * a + c * c == b * b || b * b + c * c == a * a) { cout
#include #include using namespace std; int main() { int testcase, a, b; cin >> testcase; for (int p = 0; p > a >> b; int repeated = 0; for (int i = a; i
#include #include using namespace std; int main() { int n; char digit; cin >> n >> digit; int repeated = 0; for (int i = 0; i < n; i++) { string num = to_string(i + 1); for (int k = 0; k < num.length(); k++) { if (num[k] == digit) repeated++; } } cout
결국 제어문을 얼마나 잘 짜는 것이 중요한 것 같다. #include using namespace std; int main() { int n, m; cin >> n >> m; int arr[101][101]{ 0, }; int sum = 0; for (int i = 0; i > x1 >> y1 >> x2 >> y2; for (int k = x1; k
#include using namespace std; int main() { int a, b; cin >> a >> b; int arr[1001]; int num = 1; int sum = 0, index = 0; for (int i = 0; index < 1000; i++) { for (int k = 0; k