제출 #288401

#제출 시각아이디문제언어결과실행 시간메모리
288401TangentPaint By Numbers (IOI16_paint)C++17
32 / 100
1 ms384 KiB
#include "paint.h" #include <bits/stdc++.h> using namespace std; //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; // typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; // find_by_order(), order_of_key() typedef long long ll; typedef long double dd; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<dd, dd> pdd; typedef vector<int> vii; typedef vector<ll> vll; typedef vector<dd> vdd; typedef vector<pii> vpii; typedef vector<pll> vpll; typedef vector<pdd> vpdd; typedef vector<vii> vvii; typedef vector<vll> vvll; typedef vector<vdd> vvdd; typedef vector<vpii> vvpii; typedef vector<vpll> vvpll; typedef vector<vpdd> vvpdd; typedef vector<bool> vb; const int inf = 1 << 30; #define rep(i, n) for (ll i = 0; i < n; i++) #define ffor(i, a, b) for(ll i = a; i < b; i++) #define forin(x, a) for (auto &x: a) #define all(x) x.begin(), x.end() #ifdef TEST #define dbg(x) cout << #x << ": " << x << '\n'; #define dbgc(x) cout << #x << ":"; forin(a, x) { cout << " " << a; } cout << endl; #define tassert(x) assert(x); #else #define dbg(x) #define dbgc(x) #define tassert(x) #endif std::string solve_puzzle(std::string s, std::vector<int> c) { int tot = 0; vii l, r; forin(x, c) { l.emplace_back(tot); tot += x + 1; } string res = s; int slack = s.size() - tot + 1; rep(i, l.size()) { r.emplace_back(l[i] + c[i] + slack - 1); if (c[i] > slack) { ffor(j, l[i] + slack, r[i] - slack + 1) { res[j] = 'X'; } } } rep(i, res.size()) { if (res[i] == '.') { res[i] = (slack ? '?' : '_'); } } return res; }

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

paint.cpp: In function 'std::string solve_puzzle(std::string, std::vector<int>)':
paint.cpp:33:36: 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]
   33 | #define rep(i, n) for (ll i = 0; i < n; i++)
......
   57 |   rep(i, l.size()) {
      |       ~~~~~~~~~~~                   
paint.cpp:57:3: note: in expansion of macro 'rep'
   57 |   rep(i, l.size()) {
      |   ^~~
paint.cpp:33:36: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 | #define rep(i, n) for (ll i = 0; i < n; i++)
......
   65 |   rep(i, res.size()) {
      |       ~~~~~~~~~~~~~                 
paint.cpp:65:3: note: in expansion of macro 'rep'
   65 |   rep(i, res.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...