Submission #946744

#TimeUsernameProblemLanguageResultExecution timeMemory
946744PenguinsAreCuteMutating DNA (IOI21_dna)C++17
Compilation error
0 ms0 KiB
#include "dna_ioi.h" #include <bits/stdc++.h> using namespace std; #define MAXN 121010 struct pref_sum { vector<int> v; int n; pref_sum(): n(MAXN) {v.resize(n+1,0);} void up(int x, int u) {v[x+1]=u;} void compile() {for(int i=0;++i<=n;) v[i]+=v[i-1];} int qry(int l, int r) {return v[r+1]-v[l];} } pre[3][3]; void init(std::string a, std::string b) { int n = a.size(); for(int i=-1;++i<n;) pre[a[i]%3][b[i]%3].up(i,1); for(int i=-1;++i<3;) for(int j=0;j<3;j++) pre[i][j].compile(); } int get_distance(int x, int y) { int arr[3][3]; for(int i=-1;++i<3;) for(int j=-1;++j<3;) arr[i][j]=pre[i][j].qry(x,y); for(int i=-1;++i<3;) { int cnt = 0; for(int j=-1;++j<3;) cnt+=arr[i][j]-arr[j][i]; if(cnt) return -1; } return max(arr[0][1],arr[1][0])+max(arr[0][2],arr[2][0])+min(arr[1][2],arr[2][1]); }

Compilation message (stderr)

dna.cpp:1:10: fatal error: dna_ioi.h: No such file or directory
    1 | #include "dna_ioi.h"
      |          ^~~~~~~~~~~
compilation terminated.