전체 글133 [백준] 1738번 병든 나이트 #include #define fastio cin.tie(0)->sync_with_stdio(0)using namespace std;int main () { fastio; int n, m; cin >> n >> m; if (n == 1) cout [참고]https://novlog.tistory.com/entry/CC-BOJ%EB%B0%B1%EC%A4%80-1783-%EB%B3%91%EB%93%A0-%EB%82%98%EC%9D%B4%ED%8A%B8-%EB%AC%B8%EC%A0%9C-%ED%92%80%EC%9D%B4-%EC%86%8C%EC%8A%A4-%EC%BD%94%EB%93%9C [설명]병든 나이트; 여행하는 칸 수 최소로이동횟수가 4보다 크면 이동 방법을 모두.. 2025. 4. 12. [프로그래머스] 순위 검색 #include #define fastio cin.tie(0)->sync_with_stdio(0)#define long long size_tusing namespace std;map> scores;void storeScore(vector> &tmp, int score) { string c1, c2, c3, c4; for (int i=0; i solution(vector info, vector query){ vector answer; vector> tmp(4, vector(2,"-")); for(int i=0; i>s){ if(idx>s){ if(s=="and") continue; if(idx 참고https://c.. 2025. 4. 12. [백준] 2437번 저울 #include #define fastio cin.tie(0)->sync_with_stdio(0)#define long long size_tusing namespace std;int N;int arr[1000];int main(){ cin>>N; for(int i=0; i>arr[i]; } sort(arr,arr+N); int res = 1; for(int i=0; ires){ break; } res+=arr[i]; } cout[풀이]res: 지금까지 만들 수 있는 모든 연속적인 (자연수의 범위의 끝 + 1) 이다.arr[i]가 res보다 작거나 같으면 → 이 수를 써서 기존 만들 수 있는 범위를 더 확장할 수.. 2025. 4. 10. [프로그래머스] 서버 증설 #include #define fastio cin.tie(0)->sync_with_stdio(0)#define long long size_tusing namespace std;int solution(int players[], size_t players_len, int m, int k) { int answer = 0; int server[1000] = {0}; // 충분한 크기 가정 for (size_t i = 0; i capacity) { int need = players[i] - capacity; int extra = (need + m - 1) / m; // 올림 처리 for (int j = 0; j 사람이 m명 증가 시 서버.. 2025. 4. 9. 이전 1 2 3 4 ··· 34 다음