Submission #499438

#TimeUsernameProblemLanguageResultExecution timeMemory
499438IbraheemKaučuk (COCI21_kaucuk)C++14
10 / 50
1 ms204 KiB
#include<bits/stdc++.h> using namespace std; 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(m > e && l > 0 && r == 0){ l = 1; r = 0; } if(m > e && l > 0 && r > 0){ l = 1; r = 1; } if(l > t && r > 0){ r = 1; } if(m > 0 && l == 0 && r == 0){ cout << m << ' ' << p << endl; } if(m > 0 && l > 0 && r == 0){ cout << m << '.' << l << ' ' << p << endl; } if(m > 0 && l == 0 && r > 0){ cout << m << "." << p << endl; } if(m == 0 && l > 0 && r == 0){ cout << l << " " << p << endl; } if(m == 0 && l > 0 && r > 0){ cout << l << "." << r << " " << endl; } if(m == 0 && l == 0 && r > 0){ cout << r << " " << p << endl; } i++; e = m; t = l; n--; } }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:17:14: warning: 'e' may be used uninitialized in this function [-Wmaybe-uninitialized]
   17 |         if(m > e && l > 0 && r == 0){
      |            ~~^~~
Main.cpp:25:9: warning: 't' may be used uninitialized in this function [-Wmaybe-uninitialized]
   25 |         if(l > t && r > 0){
      |         ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...