Submission #779015

#TimeUsernameProblemLanguageResultExecution timeMemory
779015vjudge1Paint By Numbers (IOI16_paint)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "paint.h" using namespace std; const int S_MAX_LEN = 200 * 1000; char buf[S_MAX_LEN + 1]; std::string solve_puzzle(std::string s, std::vector<int> c) { vector<int> pref(c.size()+1), suf(c.size()+1); vector<int> a(s.size()); /* int n=s.size(); int t=0; for(int i = n-1; i>=0; i--){ if(s[i]!='_') t++; else t = 0; a[i] = t; } int l=0, pos=0; pref[0]=-1; /*while(pos<n&&l<c.size()){ if(a[pos]>=c[l]){ pref[l+1] = pos+c[l]; pos+=c[l]+1; l++; } else{ pos++; } } t = 0; for(int i = 0; i<n; i++){ if(s[i]!='_') t++; else t = 0; a[i] = t; } suf[0] = n; pos=n-1, l = 0; /*while(pos>=0&&l<c.size()){ if(a[pos]>=c[c.size()-l-1]){ suf[l+1] = pos-c[c.size()-l-1]; pos-=c[c.size()-l-1]+1; l++; } else{ pos++; } } vector<int> vis(n), vis2(n); t=0; for(int i = n-1; i>=0; i--){ if(s[i]!='_') t++; else t = 0; a[i] = t; } for(int j=0; j<=c.size(); j++){ for(int l=max(0, pref[j]); l<=min(n-1, suf[c.size()-j]); l++){ vis[l]=1; } int ma=-1; if(j!=c.size()){ for( int l=max(-1, pref[j])+1; l<min(n, suf[c.size()-j-1]); l++){ if(a[l]>=c[j]&&l+c[j]<=min(n, suf[c.size()-j-1])){ ma=l+c[j]; } if(ma>=l){ vis2[l]=1; } } } } string x; for(int i=0; i<n; i++){ if(s[i]=='X') x+="X"; else if(s[i]=='_') x+="_"; else if(!vis[i]) x+='X'; else if(vis2[i])x+='?'; else x+='_'; } t = 0;*/ return ""; } /* int main() { #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); #endif assert(1 == scanf("%s", buf)); std::string s = buf; int c_len; assert(1 == scanf("%d", &c_len)); std::vector<int> c(c_len); for (int i = 0; i < c_len; i++) { assert(1 == scanf("%d", &c[i])); } std::string ans = solve_puzzle(s, c); // BEGIN SECRET // puts("098d134608c94f7413faac591054ee35"); // END SECRET // printf("%s\n", ans.data()); return 0; } */

Compilation message (stderr)

paint.cpp:24:5: warning: "/*" within comment [-Wcomment]
   24 |     /*while(pos<n&&l<c.size()){
      |      
paint.cpp:48:5: warning: "/*" within comment [-Wcomment]
   48 |     /*while(pos>=0&&l<c.size()){
      |      
/usr/bin/ld: /tmp/cc82AZc7.o:(.bss+0x0): multiple definition of `buf'; /tmp/ccPX93R5.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status