제출 #867941

#제출 시각아이디문제언어결과실행 시간메모리
867941becaidoKaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms456 KiB
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,popcnt,sse4,abm")
#include <bits/stdc++.h>
using namespace std;

#ifdef WAIMAI
#define debug(HEHE...) cout << "[" << #HEHE << "] : ", dout(HEHE)
void dout() {cout << '\n';}
template<typename T, typename...U>
void dout (T t, U...u) {cout << t << (sizeof... (u) ? ", " : ""), dout (u...);}
#else
#define debug(...) 7122
#endif

#define ll long long
#define Waimai ios::sync_with_stdio(false), cin.tie(0)
#define FOR(x,a,b) for (int x = a, I = b; x <= I; x++)
#define pb emplace_back
#define F first
#define S second

void solve() {
    int n;
    int a = 0, b = 0, c = 0;
    cin >> n;
    while (n--) {
        string s;
        cin >> s;
        if (s == "section") a++, b = c = 0;
        if (s == "subsection") b++, c = 0;
        if (s == "subsubsection") c++;
        cin >> s;
        cout << a;
        if (b) cout << '.' << b;
        if (c) cout << '.' << c;
        cout << ' ' << s << '\n';
    }
}

int main() {
    Waimai;
    solve();
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...