코딩테스트

    [실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

    [실5] 25497 - 기술 연계마스터 임스

    #include #include using namespace std;int main() { int n, cnt = 0; stack lr, sk; cin >> n; for (int i = 0; i > c; if (isdigit(c)) cnt++; else { if (c == 'L') lr.push(c); else if (c == 'S') sk.push(c); else if (c == 'R') { if (!lr.empty()) { lr.pop(); cnt++; } else break; } else { if (!sk.empty()) { sk.pop(); cnt++; } else ..

    [브1] 25425 - 운동회

    #include #include using namespace std;using ll = long long;int main() { ll n, m, a, k; ll max, min; cin >> n >> m >> a >> k; auto val = (a - k) / m; if (a - k >= n - 1) max = n; else { max = a - k + 1; if (a - k == 0) { cout