Submission #851810

#TimeUsernameProblemLanguageResultExecution timeMemory
851810vjudge1Kaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms344 KiB
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast,O3,unroll-loops") #define int long long #define vi vector<int> #define vvi vector<vi> #define pii pair<int, int> #define vpi vector<pii> #define vvpi vector<vpi> #define vb vector<bool> #define vvb vector<vb> #define endl "\n" #define sp << " " << #define F(i, s, n) for(int i = s; i < n; i++) #define pb push_back #define fi first #define se second int inf = LLONG_MAX >> 3; void solve() { int s1 = 0, s2 = 0, s3 = 0; int n; cin >> n; F(i, 0, n) { string type, content; cin >> type >> content; if(type == "section") { s1++; s2 = 0; s3 = 0; cout << s1 << " " << content << endl; } else if(type == "subsection") { s2++; s3 = 0; cout << s1 << "." << s2 << " " << content << endl; }else if(type == "subsubsection") { s3++; cout << s1 << "." << s2 << "." << s3 << " " << content << endl; } } } void setIO() { ios::sync_with_stdio(0); cin.tie(0); #ifdef Local freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); #endif } signed main() { setIO(); 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...