제출 #986331

#제출 시각아이디문제언어결과실행 시간메모리
986331VMaksimoski008Paint By Numbers (IOI16_paint)C++17
10 / 100
152 ms600 KiB
#include "paint.h" #include <bits/stdc++.h> using namespace std; using ll = long long; string solve_puzzle(std::string s, std::vector<int> c) { int n = s.size(); int m = c.size(); if(n - 1 <= 20) { vector<int> mp(n); int cnt = 0; for(int mask=0; mask<(1<<n); mask++) { vector<int> v; if(mask & 1) v.push_back(1); for(int i=1; i<n; i++) { if(mask & (1 << i)) { if(mask & (1 << (i-1))) v.back()++; else v.push_back(1); } } if(v == c) { cnt++; for(int i=0; i<n; i++) if(mask & (1 << i)) mp[i]++; } } string str = ""; for(int i=0; i<n; i++) { if(mp[i] == cnt) str += 'X'; else if(mp[i] > 0) str += '?'; else str += '_'; } return str; } s = "." + s; return ""; }

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

paint.cpp: In function 'std::string solve_puzzle(std::string, std::vector<int>)':
paint.cpp:8:9: warning: unused variable 'm' [-Wunused-variable]
    8 |     int m = c.size();
      |         ^
#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...