Submission #1092153

#TimeUsernameProblemLanguageResultExecution timeMemory
1092153user736482Mutating DNA (IOI21_dna)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>using namespace std;long long a,b;vector<int>pref[6]; // A/T, T/C, C/A, T/A, C/T, A/Cvoid init(string a,string b){ for(int i=0;i<6;i++) pref[i].push_back(0); for(int i=0;i<a.size();i++){ for(int i=0;i<6;i++) pref[i].push_back(pref[i].back()); if(a[i]=='A' && b[i]=='T') pref[0].back()++; if(a[i]=='T' && b[i]=='C') pref[1].back()++; if(a[i]=='C' && b[i]=='A') pref[2].back()++; if(a[i]=='T' && b[i]=='A') pref[3].back()++; if(a[i]=='C' && b[i]=='T') pref[4].back()++; if(a[i]=='A' && b[i]=='C') pref[5].back()++; }}int get_distance(int x, int y){ x++; y++; int res=0; res+=min(pref[0][y]-pref[0][x-1],pref[3][y]-pref[3][x-1]); res+=min(pref[1][y]-pref[1][x-1],pref[4][y]-pref[4][x-1]); res+=min(pref[2][y]-pref[2][x-1],pref[5][y]-pref[5][x-1]); res+=2*abs(pref[1][y]-pref[1][x-1]-pref[4][y]+pref[4][x-1]); if(abs(pref[2][y]-pref[2][x-1]-pref[5][y]+pref[5][x-1])==abs(pref[1][y]-pref[1][x-1]-pref[4][y]+pref[4][x-1]) && abs(pref[2][y]-pref[2][x-1]-pref[5][y]+pref[5][x-1])==abs(pref[0][y]-pref[0][x-1]-pref[3][y]+pref[3][x-1])) return res; else return -1;}

Compilation message (stderr)

dna.cpp:1:31: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>using namespace std;long long a,b;vector<int>pref[6]; // A/T, T/C, C/A, T/A, C/T, A/Cvoid init(string a,string b){    for(int i=0;i<6;i++)        pref[i].push_back(0);    for(int i=0;i<a.size();i++){        for(int i=0;i<6;i++)            pref[i].push_back(pref[i].back());        if(a[i]=='A' && b[i]=='T')            pref[0].back()++;        if(a[i]=='T' && b[i]=='C')            pref[1].back()++;        if(a[i]=='C' && b[i]=='A')            pref[2].back()++;        if(a[i]=='T' && b[i]=='A')            pref[3].back()++;        if(a[i]=='C' && b[i]=='T')            pref[4].back()++;        if(a[i]=='A' && b[i]=='C')            pref[5].back()++;    }}int get_distance(int x, int y){    x++;    y++;    int res=0;    res+=min(pref[0][y]-pref[0][x-1],pref[3][y]-pref[3][x-1]);    res+=min(pref[1][y]-pref[1][x-1],pref[4][y]-pref[4][x-1]);    res+=min(pref[2][y]-pref[2][x-1],pref[5][y]-pref[5][x-1]);    res+=2*abs(pref[1][y]-pref[1][x-1]-pref[4][y]+pref[4][x-1]);    if(abs(pref[2][y]-pref[2][x-1]-pref[5][y]+pref[5][x-1])==abs(pref[1][y]-pref[1][x-1]-pref[4][y]+pref[4][x-1]) && abs(pref[2][y]-pref[2][x-1]-pref[5][y]+pref[5][x-1])==abs(pref[0][y]-pref[0][x-1]-pref[3][y]+pref[3][x-1]))        return res;    else        return -1;}
      |                               ^~~~~~~~~
dna.cpp:1:10: fatal error: bits/stdc++.h>usin: No such file or directory
    1 | #include <bits/stdc++.h>using namespace std;long long a,b;vector<int>pref[6]; // A/T, T/C, C/A, T/A, C/T, A/Cvoid init(string a,string b){    for(int i=0;i<6;i++)        pref[i].push_back(0);    for(int i=0;i<a.size();i++){        for(int i=0;i<6;i++)            pref[i].push_back(pref[i].back());        if(a[i]=='A' && b[i]=='T')            pref[0].back()++;        if(a[i]=='T' && b[i]=='C')            pref[1].back()++;        if(a[i]=='C' && b[i]=='A')            pref[2].back()++;        if(a[i]=='T' && b[i]=='A')            pref[3].back()++;        if(a[i]=='C' && b[i]=='T')            pref[4].back()++;        if(a[i]=='A' && b[i]=='C')            pref[5].back()++;    }}int get_distance(int x, int y){    x++;    y++;    int res=0;    res+=min(pref[0][y]-pref[0][x-1],pref[3][y]-pref[3][x-1]);    res+=min(pref[1][y]-pref[1][x-1],pref[4][y]-pref[4][x-1]);    res+=min(pref[2][y]-pref[2][x-1],pref[5][y]-pref[5][x-1]);    res+=2*abs(pref[1][y]-pref[1][x-1]-pref[4][y]+pref[4][x-1]);    if(abs(pref[2][y]-pref[2][x-1]-pref[5][y]+pref[5][x-1])==abs(pref[1][y]-pref[1][x-1]-pref[4][y]+pref[4][x-1]) && abs(pref[2][y]-pref[2][x-1]-pref[5][y]+pref[5][x-1])==abs(pref[0][y]-pref[0][x-1]-pref[3][y]+pref[3][x-1]))        return res;    else        return -1;}
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.