Submission #1006065

#TimeUsernameProblemLanguageResultExecution timeMemory
1006065DangerNoodle7591Kaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms456 KiB
#include <bits/stdc++.h> using namespace std; #define lalala ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define endl '\n' //#define int long long int //#define ll long long #define pb push_back #define p push #define f first #define s second #define N 350 signed main(){ lalala; int n;cin>>n; int a=0,b=0,c=0; while(n--){ string x,y;cin>>x>>y; if(x=="section"){ a++; b=c=0; cout<<a<<" "<<y<<endl; } else if(x=="subsection"){ if(a==0)a=1; b++; c=0; cout<<a<<"."<<b<<" "<<y<<endl; } else{ if(a==0)a=1; if(b==0)b=1; c++; cout<<a<<"."<<b<<"."<<c<<" "<<y<<endl; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...