Submission #499433

# Submission time Handle Problem Language Result Execution time Memory
499433 2021-12-28T12:05:44 Z Ibraheem Kaučuk (COCI21_kaucuk) C++14
10 / 50
2 ms 3416 KB
#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

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 time Memory Grader output
1 Correct 2 ms 3404 KB Output is correct
2 Correct 2 ms 3404 KB Output is correct
3 Correct 1 ms 3404 KB Output is correct
4 Incorrect 2 ms 3416 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3404 KB Output is correct
2 Correct 2 ms 3404 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3404 KB Output is correct
2 Correct 2 ms 3404 KB Output is correct
3 Incorrect 2 ms 3404 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3404 KB Output is correct
2 Correct 2 ms 3404 KB Output is correct
3 Correct 1 ms 3404 KB Output is correct
4 Incorrect 2 ms 3416 KB Output isn't correct
5 Halted 0 ms 0 KB -