답안 #624807

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
624807 2022-08-08T18:56:47 Z rm1729 마라톤 경주 (COCI14_utrka) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long

void solve(){
    int n; cin >>n;
    map <string,vector <int>> si;
    map <int,string> is;

    for(int i=0; i<n; i++){
        string s;
        cin >>s;
        if(si[s].size()==0) si[s].push_back(0);
        si[s].push_back(i);
        si[s][0]++;
        is[i]=s;
    }

    vector <bool> check(n, true);
    for(int i=0; i<n-1; i++){
        string s;
        cin >>s;
        int k = si[s][si[s][0]];
        si[s][0]--;
        check[k]=false;
    }
    for(int i=0; i<n; i++){
        if(check[i]) cout <<is[i]; 
    }
}

signed main(){
    int t=1;// cin >>t;
    while(t--){
        solve();
    }
    return 0;
}#include <bits/stdc++.h>
using namespace std;
#define int long long

void solve(){
    int n; cin >>n;
    map <string,vector <int>> si;
    map <int,string> is;

    for(int i=0; i<n; i++){
        string s;
        cin >>s;
        if(si[s].size()==0) si[s].push_back(0);
        si[s].push_back(i);
        si[s][0]++;
        is[i]=s;
    }

    vector <bool> check(n, true);
    for(int i=0; i<n-1; i++){
        string s;
        cin >>s;
        int k = si[s][si[s][0]];
        si[s][0]--;
        check[k]=false;
    }
    for(int i=0; i<n; i++){
        if(check[i]) cout <<is[i]; 
    }
}

signed main(){
    int t=1;// cin >>t;
    while(t--){
        solve();
    }
    return 0;
}

Compilation message

utrka.cpp:38:2: error: stray '#' in program
   38 | }#include <bits/stdc++.h>
      |  ^
utrka.cpp:38:3: error: 'include' does not name a type
   38 | }#include <bits/stdc++.h>
      |   ^~~~~~~
utrka.cpp:42:6: error: redefinition of 'void solve()'
   42 | void solve(){
      |      ^~~~~
utrka.cpp:5:6: note: 'void solve()' previously defined here
    5 | void solve(){
      |      ^~~~~
utrka.cpp:69:8: error: redefinition of 'int main()'
   69 | signed main(){
      |        ^~~~
utrka.cpp:32:8: note: 'int main()' previously defined here
   32 | signed main(){
      |        ^~~~