제출 #598858

#제출 시각아이디문제언어결과실행 시간메모리
598858fuad27Paint By Numbers (IOI16_paint)C++17
32 / 100
2 ms212 KiB
#include<bits/stdc++.h> #include "paint.h" using namespace std; #define rep(i,a,b) for(int i=int(a);i<int(b);i++) string solve_puzzle(string s, vector<int> c) { int n=s.size(),k=c.size(); string ans=""; rep(i,0,n)ans.push_back('X'); int extra=n+1; rep(i,0,k)extra-=c[i]+1; if(!extra) { int sum=c[0]; rep(i,1,k) { ans[sum]='_'; sum+=c[i]+1; } return ans; } int sum=0; int z = 0; rep(i,0,k) { rep(j,sum,sum+extra)ans[j]='?'; sum+=c[i]; rep(j,sum,sum+extra)ans[j]='?'; sum++; } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

paint.cpp: In function 'std::string solve_puzzle(std::string, std::vector<int>)':
paint.cpp:20:6: warning: unused variable 'z' [-Wunused-variable]
   20 |  int z = 0;
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...