이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <map>
using namespace std;
int main(){
map<string,string>mp;
string s,t;
int n;
cin>>n;
int s1=0;
int s2=0;
int s3=0;
for(int i=0;i<n;i++){
cin>>s>>t;
if(s=="section"){
s1++;
mp[t]=to_string(s1);
}
if(s=="subsection"){
s2++;
mp[t]=to_string(s1)+"."+to_string(s2);
}
if(s=="subsubsection"){
s3++;
mp[t]=to_string(s1)+"."+to_string(s2)+"."+to_string(s3);
}
}
for(auto u:mp){
cout<<u.second<<" "<<u.first<<endl;
}
}
# | 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... |