답안 #1007235

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1007235 2024-06-24T13:36:04 Z Faggi Data Transfer (IOI19_transfer) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>using namespace std;//0 par 1 imparstd::vector<int> get_attachment(std::vector<int> source) {    vector<int>ret;    int un=0;    for(auto k:source)    {        if(k==1)        un++;    }            for(auto k:source)        ret.push_back(k);    if(un%2==0)        ret.push_back(0);    else        ret.push_back(1);                return ret;}std::vector<int> retrieve(std::vector<int> data) {    int bit, i, un=0;    vector<int>a,b;    bit=data[int(data.size())-1];    data.pop_back();    for(i=0; i<int(data.size())/2; i++)    {        a.push_back(data[i]);        if(data[i]==1)        un++;    }            if(un%2==0&&bit==0)        return a;    else if(un%2==1&&bit==1)    return a;        for(i=int(data.size())/2; i<int(data.size()); i++)    {        b.push_back(data[i]);    }                return b;}

Compilation message

transfer.cpp:1:31: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>using namespace std;//0 par 1 imparstd::vector<int> get_attachment(std::vector<int> source) {    vector<int>ret;    int un=0;    for(auto k:source)    {        if(k==1)        un++;    }            for(auto k:source)        ret.push_back(k);    if(un%2==0)        ret.push_back(0);    else        ret.push_back(1);                return ret;}std::vector<int> retrieve(std::vector<int> data) {    int bit, i, un=0;    vector<int>a,b;    bit=data[int(data.size())-1];    data.pop_back();    for(i=0; i<int(data.size())/2; i++)    {        a.push_back(data[i]);        if(data[i]==1)        un++;    }            if(un%2==0&&bit==0)        return a;    else if(un%2==1&&bit==1)    return a;        for(i=int(data.size())/2; i<int(data.size()); i++)    {        b.push_back(data[i]);    }                return b;}
      |                               ^~~~~~~~~
transfer.cpp:1:10: fatal error: bits/stdc++.h>usin: No such file or directory
    1 | #include <bits/stdc++.h>using namespace std;//0 par 1 imparstd::vector<int> get_attachment(std::vector<int> source) {    vector<int>ret;    int un=0;    for(auto k:source)    {        if(k==1)        un++;    }            for(auto k:source)        ret.push_back(k);    if(un%2==0)        ret.push_back(0);    else        ret.push_back(1);                return ret;}std::vector<int> retrieve(std::vector<int> data) {    int bit, i, un=0;    vector<int>a,b;    bit=data[int(data.size())-1];    data.pop_back();    for(i=0; i<int(data.size())/2; i++)    {        a.push_back(data[i]);        if(data[i]==1)        un++;    }            if(un%2==0&&bit==0)        return a;    else if(un%2==1&&bit==1)    return a;        for(i=int(data.size())/2; i<int(data.size()); i++)    {        b.push_back(data[i]);    }                return b;}
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.