제출 #796618

#제출 시각아이디문제언어결과실행 시간메모리
796618mindiyakPaint By Numbers (IOI16_paint)C++14
32 / 100
1 ms312 KiB
#include "paint.h" #pragma GCC optimize("O3") #pragma GCC target("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef pair<ld, ld> pd; typedef vector<int> vi; typedef vector<bool> vb; typedef vector<vector<int>> vvi; typedef vector<ld> vd; typedef vector<ll> vl; typedef vector<pi> vpi; typedef vector<pl> vpl; #define FOR(i, a, b) for (ll i = a; i < (b); i++) #define F0R(i, a) for (ll i = 0; i < (a); i++) #define FORd(i, a, b) for (ll i = (b)-1; i >= a; i--) #define F0Rd(i, a) for (ll i = (a)-1; i >= 0; i--) #define trav(a, x) for (auto &a : x) #define uid(a, b) uniform_int_distribution<int>(a, b)(rng) #define len(x) (int)(x).size() #define mp make_pair #define pb push_back #define fst first #define nl endl #define sec second #define lb lower_bound #define ub upper_bound #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define ins insert const int MOD = 1000000007; const int MX = INT_MAX; const int MN = INT_MIN; string solve_puzzle(string s, vector<int> c) { int n=s.length(); string ans(n,'_'); int all = c.size()-1; FOR(i,0,c.size())all+=c[i]; FOR(i,0,n-all+1){ string temp(n,'_'); int pos = i; FOR(j,0,c.size()){ FOR(k,0,c[j]){ temp[pos+k]='X'; } pos+=c[j]+1; } // cout << temp << endl; if(i==0)ans = temp; else{ FOR(j,0,n){ if(ans[j]!=temp[j])ans[j]='?'; } } } return ans; }

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

paint.cpp: In function 'std::string solve_puzzle(std::string, std::vector<int>)':
paint.cpp:18:39: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 | #define FOR(i, a, b) for (ll i = a; i < (b); i++)
      |                                       ^
paint.cpp:43:5: note: in expansion of macro 'FOR'
   43 |     FOR(i,0,c.size())all+=c[i];
      |     ^~~
paint.cpp:18:39: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 | #define FOR(i, a, b) for (ll i = a; i < (b); i++)
      |                                       ^
paint.cpp:48:9: note: in expansion of macro 'FOR'
   48 |         FOR(j,0,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...