답안 #528373

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
528373 2022-02-20T08:12:27 Z Slavita Osumnjičeni (COCI21_osumnjiceni) C++14
0 / 110
1 ms 484 KB
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define ve vector<int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pi pair<int,int>
#define all(v) v.begin(),v.end()
#define si(v) (int)v.size()
#define en '\n'
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_muiltiset tree<int, null_type,less_equal<>, rb_tree_tag,tree_order_statistics_node_update>
//#define int long long
using namespace std;
//using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;

const int N = 1e5 + 228;
const int big = 1e9;
//ordered_set os; // os.order_of_key(4), (*os.find_by_order(5))
int n, m, ans, kol[10];

//#undef int
int main(){
    //#define int long long
    iostream::sync_with_stdio(false); cin.tie(0); ios_base::sync_with_stdio(false); cout.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    cin >> n;
    for (int i = 1; i <= n; i++){
        string t, s; cin >> t >> s;
        if (t == "section"){
            kol[2] = 0;
            kol[3] = 0;

            kol[1]++;
            cout << kol[1] << ' ' << s << en;
        } else if (t == "subsection"){
            kol[3] = 0;

            kol[2]++;
            cout << kol[1] << '.' << kol[2] << ' ' << s << en;
        } else if (t == "subsubsection"){
            kol[3]++;
            cout << kol[1] << '.' << kol[2] << '.' << kol[3] << ' ' << s << en;
        }else assert(0);
    }
    return 0;
}
/*
40
section first
subsection zavod
subsubsection nekoglaya
section second
subsection dlya
subsubsection nekoglay
subsubsection nekoglay
subsubsection nekoglay
subsection dly2
subsection dl3
subsubsection dibila
subsection dl4
section zivotinje
subsection macke
subsection psi
subsubsection mops
subsubsection mop2
subsubsection mop3
subsection psih
subsubsection moppppp
subsubsection moppppr
subsubsection moppppb
subsubsection mob
section zivotinje
subsection tilox
subsubsection sam
subsubsection takoy
subsection tilox3
subsection tilox2
section ban
subsection banan
subsubsection banbanan
subsection banan2
subsubsection banbanan
subsection banan3
subsubsection banbanan
subsection banan4
subsubsection banbanan
subsubsection banbanan2
subsection bananwaht
*/
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 460 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 460 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 460 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 484 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 460 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -