코딩테스트/백준

    [실3] 16967 - 배열 복원하기

    #include #include #include #include #include #include using namespace std;//using IntPair = pair;int main() { int h, w, x, y; cin >> h >> w >> x >> y; vector> v(h + x, vector(w + y)); for (int i = 0; i > v[i][j]; } for (int i = x; i

    [실4] 2217 - 로프

    int input[100001];int n, ans;int main() { cin >> n; for (int i = 0; i > input[i]; sort(input, input + n); for (int i = 0; i

    [실5] 10814 - 나이순 정렬

    #include #include #include #include #include #include using namespace std;//using IntPair = pair;#define MAX 201int main() { int n; cin >> n; map m; vector> v(MAX); for (int i = 0; i > a >> str; v[a].push(str); } for (int i = 0; i

    [실5] 4673 - 셀프 넘버

    #define MAX 10001int SelfNumber(int n){ int sum = n; while (n) { sum += n % 10; n /= 10; } return sum;}int main() { bool chk[MAX]{ false }; for (int i = 1; i

    [실4] 1748 - 수 이어 쓰기 1

    #include using namespace std;//using IntPair = pair;int main() { int n, res = 0; cin >> n; for (int i = 1; i

    [브2] 17608 - 막대기

    #include using namespace std;int main() { int n; cin >> n; vector v(n); for (int i = 0; i > v[i]; int cnt = 0, max = 0; for (int i = n - 1; i >= 0; i--) { if (v[i] > max) { max = v[i]; cnt++; } } cout

    [실5] 1418 - K-세준수

    #include using namespace std;int main() { int n, k, res = 0; cin >> n >> k; for (int i = 1; i

    [브1] 3985 - 롤 케이크

    #include #include #include #include using namespace std;using IntPair = pair;int main() { int n,sz, mx = 0, mx2 = 0; cin >> n >> sz; vector v(n + 1); IntPair ans; for (int i = 0; i > a >> b; if (b - a > mx) { mx = b - a; ans.first = i + 1; } for (int j = a; j mx2) { mx2 = cnt; ans.second = i + 1; } cnt = 0; } cout

    [실4] 2870 - 수학숙제

    #include #include #include #include using namespace std;using IntPair = pair;vector ans;bool Cmp(const string& str1, const string& str2) { int sz1 = str1.size(), sz2 = str2.size(); if (sz1 == sz2) return str1 > n; while (n--) { string str, num; cin >> str; int cnt = 0; for (auto iter = str.begin(); iter != str.end(); iter++) { auto c = *iter; if (isdigit(c)) { if (num.size() == 1 ..

    [실5] 7568 - 덩치

    #include #include using namespace std;using IntPair = pair;int main() { int n; cin >> n; vector v(n); vector res(n); for (int i = 0; i > v[i].first >> v[i].second; for (int i = 0; i