제출 #428140

#제출 시각아이디문제언어결과실행 시간메모리
428140Maqsut_03Paint By Numbers (IOI16_paint)C++14
32 / 100
1 ms204 KiB
#include "paint.h" #include <cstdlib> #include<bits/stdc++.h> #define ll long long #define ff first #define ss second using namespace std; string ans; int n, k; bool used[222222]; std::string solve_puzzle(std::string s, std::vector<int> v) { n = s.size(), k = v.size(); int t = 0; // cout << n << " " << k << "\n"; ll sum = 0; for (int i=0; i<n; i++) ans += "X"; for (int i=0; i<k; i++) sum += v[i]; sum += k - 1; int q = n - sum, j =0; // cout << sum << " " << q << "\n"; for (int i=0; i<k; i++) { int j0 = j; for (int l=j; l<j0 + q; l++) ans[l] = '?'; j += v[i]; j0 = j; for (int l=j; l<j0 + q; l++) ans[l] = '?'; j++; } if (q == 0) { j = 0; for (int i=0; i<k; i++) { ans[j+v[i]] = '_'; j += v[i] + 1; } } return ans; }

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

paint.cpp: In function 'std::string solve_puzzle(std::string, std::vector<int>)':
paint.cpp:17:9: warning: unused variable 't' [-Wunused-variable]
   17 |     int t = 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...