이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define REP(i,a,b) for (auto i = (a); i <= (b); ++i)
#define debug(x) cerr << #x << " is " << x << endl
#define el '\n'
using namespace std; using ll = long long;
const int N = 103;
int main() {
cin.tie(0)->sync_with_stdio(0);
int n; cin >> n;
pair<int,pair<int,int>> x {0,{0,0}};
REP(i,1,n) {
string command, q;
cin >> command >> q;
if (command == "section") {
cout << ++x.first << ' ' << q << el;
x.second = {0,0};
} else if (command == "subsection") {
cout << x.first << '.' << ++(x.second.first) << ' ' << q << el;
x.second.second = 0;
} else {
cout << x.first << '.' << x.second.first << '.' << ++(x.second.second) << ' ' << q << el;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |