Submission #499433

#TimeUsernameProblemLanguageResultExecution timeMemory
499433IbraheemKaučuk (COCI21_kaucuk)C++14
10 / 50
2 ms3416 KiB
#include<bits/stdc++.h> using namespace std; string a[100005]; int main(){ int n , m = 0 , l = 0 , r = 0 , t , e , i = 1; string s = "section" , f = "subsection" , d = "subsubsection" , o , p; cin >> n; while(n > 0){ cin >> o >> p; if(o == s){ m++; }else if(o == f){ l++; } if(o == d){ r++; } if(l == 0 ){ cout << m << ' ' << p << endl; } if(l > 0 && m !=0 && r == 0){ cout << m << '.' << l << ' ' << p << endl; } if(m == 0 && l > 0){ cout << l << " " << p << endl; } if(m > 0 && l > 0 && r > 0){ cout << m << "." << l << "." << r << " " << p << endl; } a[i] = p; i++; n--; } }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:5:37: warning: unused variable 't' [-Wunused-variable]
    5 |     int n , m = 0 , l = 0 , r = 0 , t , e , i = 1;
      |                                     ^
Main.cpp:5:41: warning: unused variable 'e' [-Wunused-variable]
    5 |     int n , m = 0 , l = 0 , r = 0 , t , e , i = 1;
      |                                         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...