| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 224428 | DedMaxim | Aliens (IOI16_aliens) | C++17 | Compilation error | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
namespace NSubtask1 {
#include <bits/stdc++.h>
long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) {
std::vector<std::vector<bool>> used(m, std::vector<bool>(m, false));
for (int i = 0; i < n; ++i) {
int left = r[i], right = c[i];
if (left > right)
std::swap(left, right);
for (int x = left; x <= right; ++x) {
for (int y = left; y <= right; ++y) {
used[x][y] = true;
}
}
}
long long result = 0;
for (int x = 0; x != m; ++x) {
for (int y = 0; y != m; ++y) {
result += used[x][y];
}
}
return result;
}
} // namespace NSubtask1
#include <bits/stdc++.h>
long long INF = 2e9;
long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) {
if (n == k) {
return NSubtask1::take_photos(n, m, k, r, c);
}
std::vector<std::vector<long long>> dp(n + 1, std::vector<long long>(k + 1, INF));
std::vector<std::pair<int, int>> points(n);
auto cost = [&](int i, int j) {
int r = points[j].first;
int l = points[i].first;
return (r - l + 1) * 1ll * (r - l + 1);
};
auto comparator = [&](const std::pair<int, int>& a, const std::pair<int, int>& b) {
return a.first < b.first;
};
std::sort(points.begin(), points.end(), comparator);
for (int i = 0; i <= k; ++i) {
dp[0][i] = 1;
}
for (int i = 1; i <= n; ++i) {
points[i - 1] = {r[i - 1], c[i - 1]};
for (int t = 0; t < i; ++t) {
for (int j = 1; j <= k; ++j) {
dp[i][j] = std::min(dp[i][j], dp[t][j - 1] + cost(t, i - 1));
}
}
}
return dp[n][k];
}
Compilation message (stderr)
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:35:0,
from aliens.cpp:2:
/usr/include/c++/7/cctype:64:11: error: '::isalnum' has not been declared
using ::isalnum;
^~~~~~~
/usr/include/c++/7/cctype:65:11: error: '::isalpha' has not been declared
using ::isalpha;
^~~~~~~
/usr/include/c++/7/cctype:66:11: error: '::iscntrl' has not been declared
using ::iscntrl;
^~~~~~~
/usr/include/c++/7/cctype:67:11: error: '::isdigit' has not been declared
using ::isdigit;
^~~~~~~
/usr/include/c++/7/cctype:68:11: error: '::isgraph' has not been declared
using ::isgraph;
^~~~~~~
/usr/include/c++/7/cctype:69:11: error: '::islower' has not been declared
using ::islower;
^~~~~~~
/usr/include/c++/7/cctype:70:11: error: '::isprint' has not been declared
using ::isprint;
^~~~~~~
/usr/include/c++/7/cctype:71:11: error: '::ispunct' has not been declared
using ::ispunct;
^~~~~~~
/usr/include/c++/7/cctype:72:11: error: '::isspace' has not been declared
using ::isspace;
^~~~~~~
/usr/include/c++/7/cctype:73:11: error: '::isupper' has not been declared
using ::isupper;
^~~~~~~
/usr/include/c++/7/cctype:74:11: error: '::isxdigit' has not been declared
using ::isxdigit;
^~~~~~~~
/usr/include/c++/7/cctype:75:11: error: '::tolower' has not been declared
using ::tolower;
^~~~~~~
/usr/include/c++/7/cctype:76:11: error: '::toupper' has not been declared
using ::toupper;
^~~~~~~
/usr/include/c++/7/cctype:87:11: error: '::isblank' has not been declared
using ::isblank;
^~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:40:0,
from aliens.cpp:2:
/usr/include/c++/7/clocale:53:11: error: '::lconv' has not been declared
using ::lconv;
^~~~~
/usr/include/c++/7/clocale:54:11: error: '::setlocale' has not been declared
using ::setlocale;
^~~~~~~~~
/usr/include/c++/7/clocale:55:11: error: '::localeconv' has not been declared
using ::localeconv;
^~~~~~~~~~
In file included from /usr/include/c++/7/cmath:47:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:41,
from aliens.cpp:2:
/usr/include/c++/7/bits/std_abs.h:52:11: error: '::abs' has not been declared
using ::abs;
^~~
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:41:0,
from aliens.cpp:2:
/usr/include/c++/7/cmath:83:11: error: '::acos' has not been declared
using ::acos;
^~~~
/usr/include/c++/7/cmath:102:11: error: '::asin' has not been declared
using ::asin;
^~~~
/usr/include/c++/7/cmath:121:11: error: '::atan' has not been declared
using ::atan;
^~~~
/usr/include/c++/7/cmath:140:11: error: '::atan2' has not been declared
using ::atan2;
^~~~~
/usr/include/c++/7/cmath:161:11: error: '::ceil' has not been declared
using ::ceil;
^~~~
/usr/include/c++/7/cmath:180:11: error: '::cos' has not been declared
using ::cos;
^~~
/usr/include/c++/7/cmath:199:11: error: '::cosh' has not been declared
using ::cosh;
^~~~
/usr/include/c++/7/cmath:218:11: error: '::exp' has not been declared
using ::exp;
^~~
/usr/include/c++/7/cmath:237:11: error: '::fabs' has not been declared
using ::fabs;
^~~~
/usr/include/c++/7/cmath:256:11: error: '::floor' has not been declared
using ::floor;
^~~~~
/usr/include/c++/7/cmath:275:11: error: '::fmod' has not been declared
using ::fmod;
^~~~
/usr/include/c++/7/cmath:296:11: error: '::frexp' has not been declared
using ::frexp;
^~~~~
/usr/include/c++/7/cmath:315:11: error: '::ldexp' has not been declared
using ::ldexp;
^~~~~
/usr/include/c++/7/cmath:334:11: error: '::log' has not been declared
using ::log;
^~~
/usr/include/c++/7/cmath:353:11: error: '::log10' has not been declared
using ::log10;
^~~~~
/usr/include/c++/7/cmath:372:11: error: '::modf' has not been declared
using ::modf;
^~~~
/usr/include/c++/7/cmath:384:11: error: '::pow' has not been declared
using ::pow;
^~~
/usr/include/c++/7/cmath:421:11: error: '::sin' has not been declared
using ::sin;
^~~
/usr/include/c++/7/cmath:440:11: error: '::sinh' has not been declared
using ::sinh;
^~~~
/usr/include/c++/7/cmath:459:11: error: '::sqrt' has not been declared
using ::sqrt;
^~~~
/usr/include/c++/7/cmath:478:11: error: '::tan' has not been declared
using ::tan;
^~~
/usr/include/c++/7/cmath:497:11: error: '::tanh' has not been declared
using ::tanh;
^~~~
/usr/include/c++/7/cmath:1080:11: error: '::double_t' has not been declared
using ::double_t;
^~~~~~~~
/usr/include/c++/7/cmath:1081:11: error: '::float_t' has not been declared
using ::float_t;
^~~~~~~
/usr/include/c++/7/cmath:1084:11: error: '::acosh' has not been declared
using ::acosh;
^~~~~
/usr/include/c++/7/cmath:1085:11: error: '::acoshf' has not been declared
using ::acoshf;
^~~~~~
/usr/include/c++/7/cmath:1086:11: error: '::acoshl' has not been declared
using ::acoshl;
^~~~~~
/usr/include/c++/7/cmath:1088:11: error: '::asinh' has not been declared
using ::asinh;
^~~~~
/usr/include/c++/7/cmath:1089:11: error: '::asinhf' has not been declared
using ::asinhf;
^~~~~~
/usr/include/c++/7/cmath:1090:11: error: '::asinhl' has not been declared
using ::asinhl;
^~~~~~
/usr/include/c++/7/cmath:1092:11: error: '::atanh' has not been declared
using ::atanh;
^~~~~
/usr/include/c++/7/cmath:1093:11: error: '::atanhf' has not been declared
using ::atanhf;
^~~~~~
/usr/include/c++/7/cmath:1094:11: error: '::atanhl' has not been declared
using ::atanhl;
^~~~~~
/usr/include/c++/7/cmath:1096:11: error: '::cbrt' has not been declared
using ::cbrt;
^~~~
/usr/include/c++/7/cmath:1097:11: error: '::cbrtf' has not been declared
using ::cbrtf;
^~~~~
/usr/include/c++/7/cmath:1098:11: error: '::cbrtl' has not been declared
using ::cbrtl;
^~~~~
/usr/include/c++/7/cmath:1100:11: error: '::copysign' has not been declared
using ::copysign;
^~~~~~~~
/usr/include/c++/7/cmath:1101:11: error: '::copysignf' has not been declared
using ::copysignf;
^~~~~~~~~
/usr/include/c++/7/cmath:1102:11: error: '::copysignl' has not been declared
using ::copysignl;
^~~~~~~~~
/usr/include/c++/7/cmath:1104:11: error: '::erf' has not been declared
using ::erf;
^~~
/usr/include/c++/7/cmath:1105:11: error: '::erff' has not been declared
using ::erff;
^~~~
/usr/include/c++/7/cmath:1106:11: error: '::erfl' has not been declared
using ::erfl;
^~~~
/usr/include/c++/7/cmath:1108:11: error: '::erfc' has not been declared
using ::erfc;
^~~~
/usr/include/c++/7/cmath:1109:11: error: '::erfcf' has not been declared
using ::erfcf;
^~~~~
/usr/include/c++/7/cmath:1110:11: error: '::erfcl' has not been declared
using ::erfcl;
^~~~~
/usr/include/c++/7/cmath:1112:11: error: '::exp2' has not been declared
using ::exp2;
^~~~
/usr/include/c++/7/cmath:1113:11: error: '::exp2f' has not been declared
using ::exp2f;
^~~~~
/usr/include/c++/7/cmath:1114:11: error: '::exp2l' has not been declared
using ::exp2l;
^~~~~
/usr/include/c++/7/cmath:1116:11: error: '::expm1' has not been declared
using ::expm1;
^~~~~
/usr/include/c++/7/cmath:1117:11: error: '::expm1f' has not been declared
using ::expm1f;
^~~~~~
/usr/include/c++/7/cmath:1118:11: error: '::expm1l' has not been declared
using ::expm1l;
^~~~~~
/usr/include/c++/7/cmath:1120:11: error: '::fdim' has not been declared
using ::fdim;
^~~~
/usr/include/c++/7/cmath:1121:11: error: '::fdimf' has not been declared
using ::fdimf;
^~~~~
/usr/include/c++/7/cmath:1122:11: error: '::fdiml' has not been declared
using ::fdiml;
^~~~~
/usr/include/c++/7/cmath:1124:11: error: '::fma' has not been declared
using ::fma;
^~~
/usr/include/c++/7/cmath:1125:11: error: '::fmaf' has not been declared
using ::fmaf;
^~~~
/usr/include/c++/7/cmath:1126:11: error: '::fmal' has not been declared
using ::fmal;
^~~~
/usr/include/c++/7/cmath:1128:11: error: '::fmax' has not been declared
using ::fmax;
^~~~
/usr/include/c++/7/cmath:1129:11: error: '::fmaxf' has not been declared
using ::fmaxf;
^~~~~
/usr/include/c++/7/cmath:1130:11: error: '::fmaxl' has not been declared
using ::fmaxl;
^~~~~
/usr/include/c++/7/cmath:1132:11: error: '::fmin' has not been declared
using ::fmin;
^~~~
/usr/include/c++/7/cmath:1133:11: error: '::fminf' has not been declared
using ::fminf;
^~~~~
/usr/include/c++/7/cmath:1134:11: error: '::fminl' has not been declared
using ::fminl;
^~~~~
/usr/include/c++/7/cmath:1136:11: error: '::hypot' has not been declared
using ::hypot;
^~~~~
/usr/include/c++/7/cmath:1137:11: error: '::hypotf' has not been declared
using ::hypotf;
^~~~~~
/usr/include/c++/7/cmath:1138:11: error: '::hypotl' has not been declared
using ::hypotl;
^~~~~~
/usr/include/c++/7/cmath:1140:11: error: '::ilogb' has not been declared
using ::ilogb;
^~~~~
/usr/include/c++/7/cmath:1141:11: error: '::ilogbf' has not been declared
using ::ilogbf;
^~~~~~
/usr/include/c++/7/cmath:1142:11: error: '::ilogbl' has not been declared
using ::ilogbl;
^~~~~~
/usr/include/c++/7/cmath:1144:11: error: '::lgamma' has not been declared
using ::lgamma;
^~~~~~
/usr/include/c++/7/cmath:1145:11: error: '::lgammaf' has not been declared
using ::lgammaf;
^~~~~~~
/usr/include/c++/7/cmath:1146:11: error: '::lgammal' has not been declared
using ::lgammal;
^~~~~~~
/usr/include/c++/7/cmath:1149:11: error: '::llrint' has not been declared
using ::llrint;
^~~~~~
/usr/include/c++/7/cmath:1150:11: error: '::llrintf' has not been declared
using ::llrintf;
^~~~~~~
/usr/include/c++/7/cmath:1151:11: error: '::llrintl' has not been declared
using ::llrintl;
^~~~~~~
/usr/include/c++/7/cmath:1153:11: error: '::llround' has not been declared
using ::llround;
^~~~~~~
/usr/include/c++/7/cmath:1154:11: error: '::llroundf' has not been declared
using ::llroundf;
^~~~~~~~
/usr/include/c++/7/cmath:1155:11: error: '::llroundl' has not been declared
using ::llroundl;
^~~~~~~~
/usr/include/c++/7/cmath:1158:11: error: '::log1p' has not been declared
using ::log1p;
^~~~~
/usr/include/c++/7/cmath:1159:11: error: '::log1pf' has not been declared
using ::log1pf;
^~~~~~
/usr/include/c++/7/cmath:1160:11: error: '::log1pl' has not been declared
using ::log1pl;
^~~~~~
/usr/include/c++/7/cmath:1162:11: error: '::log2' has not been declared
using ::log2;
^~~~
/usr/include/c++/7/cmath:1163:11: error: '::log2f' has not been declared
using ::log2f;
^~~~~
/usr/include/c++/7/cmath:1164:11: error: '::log2l' has not been declared
using ::log2l;
^~~~~
/usr/include/c++/7/cmath:1166:11: error: '::logb' has not been declared
using ::logb;
^~~~
/usr/include/c++/7/cmath:1167:11: error: '::logbf' has not been declared
using ::logbf;
^~~~~
/usr/include/c++/7/cmath:1168:11: error: '::logbl' has not been declared
using ::logbl;
^~~~~
/usr/include/c++/7/cmath:1170:11: error: '::lrint' has not been declared
using ::lrint;
^~~~~
/usr/include/c++/7/cmath:1171:11: error: '::lrintf' has not been declared
using ::lrintf;
^~~~~~
/usr/include/c++/7/cmath:1172:11: error: '::lrintl' has not been declared
using ::lrintl;
^~~~~~
/usr/include/c++/7/cmath:1174:11: error: '::lround' has not been declared
using ::lround;
^~~~~~
/usr/include/c++/7/cmath:1175:11: error: '::lroundf' has not been declared
using ::lroundf;
^~~~~~~
/usr/include/c++/7/cmath:1176:11: error: '::lroundl' has not been declared
using ::lroundl;
^~~~~~~
/usr/include/c++/7/cmath:1178:11: error: '::nan' has not been declared
using ::nan;
^~~
/usr/include/c++/7/cmath:1179:11: error: '::nanf' has not been declared
using ::nanf;
^~~~
/usr/include/c++/7/cmath:1180:11: error: '::nanl' has not been declared
using ::nanl;
^~~~
/usr/include/c++/7/cmath:1182:11: error: '::nearbyint' has not been declared
using ::nearbyint;
^~~~~~~~~
/usr/include/c++/7/cmath:1183:11: error: '::nearbyintf' has not been declared
using ::nearbyintf;
^~~~~~~~~~
/usr/include/c++/7/cmath:1184:11: error: '::nearbyintl' has not been declared
using ::nearbyintl;
^~~~~~~~~~
/usr/include/c++/7/cmath:1186:11: error: '::nextafter' has not been declared
using ::nextafter;
^~~~~~~~~
/usr/include/c++/7/cmath:1187:11: error: '::nextafterf' has not been declared
using ::nextafterf;
^~~~~~~~~~
/usr/include/c++/7/cmath:1188:11: error: '::nextafterl' has not been declared
using ::nextafterl;
^~~~~~~~~~
/usr/include/c++/7/cmath:1190:11: error: '::nexttoward' has not been declared
using ::nexttoward;
^~~~~~~~~~
/usr/include/c++/7/cmath:1191:11: error: '::nexttowardf' has not been declared
using ::nexttowardf;
^~~~~~~~~~~
/usr/include/c++/7/cmath:1192:11: error: '::nexttowardl' has not been declared
using ::nexttowardl;
^~~~~~~~~~~
/usr/include/c++/7/cmath:1194:11: error: '::remainder' has not been declared
using ::remainder;
^~~~~~~~~
/usr/include/c++/7/cmath:1195:11: error: '::remainderf' has not been declared
using ::remainderf;
^~~~~~~~~~
/usr/include/c++/7/cmath:1196:11: error: '::remainderl' has not been declared
using ::remainderl;
^~~~~~~~~~
/usr/include/c++/7/cmath:1198:11: error: '::remquo' has not been declared
using ::remquo;
^~~~~~
/usr/include/c++/7/cmath:1199:11: error: '::remquof' has not been declared
using ::remquof;
^~~~~~~
/usr/include/c++/7/cmath:1200:11: error: '::remquol' has not been declared
using ::remquol;
^~~~~~~
/usr/include/c++/7/cmath:1202:11: error: '::rint' has not been declared
using ::rint;
^~~~
/usr/include/c++/7/cmath:1203:11: error: '::rintf' has not been declared
using ::rintf;
^~~~~
/usr/include/c++/7/cmath:1204:11: error: '::rintl' has not been declared
using ::rintl;
^~~~~
/usr/include/c++/7/cmath:1206:11: error: '::round' has not been declared
using ::round;
^~~~~
/usr/include/c++/7/cmath:1207:11: error: '::roundf' has not been declared
using ::roundf;
^~~~~~
/usr/include/c++/7/cmath:1208:11: error: '::roundl' has not been declared
using ::roundl;
^~~~~~
/usr/include/c++/7/cmath:1210:11: error: '::scalbln' has not been declared
using ::scalbln;
^~~~~~~
/usr/include/c++/7/cmath:1211:11: error: '::scalblnf' has not been declared
using ::scalblnf;
^~~~~~~~
/usr/include/c++/7/cmath:1212:11: error: '::scalblnl' has not been declared
using ::scalblnl;
^~~~~~~~
/usr/include/c++/7/cmath:1214:11: error: '::scalbn' has not been declared
using ::scalbn;
^~~~~~
/usr/include/c++/7/cmath:1215:11: error: '::scalbnf' has not been declared
using ::scalbnf;
^~~~~~~
/usr/include/c++/7/cmath:1216:11: error: '::scalbnl' has not been declared
using ::scalbnl;
^~~~~~~
/usr/include/c++/7/cmath:1218:11: error: '::tgamma' has not been declared
using ::tgamma;
^~~~~~
/usr/include/c++/7/cmath:1219:11: error: '::tgammaf' has not been declared
using ::tgammaf;
^~~~~~~
/usr/include/c++/7/cmath:1220:11: error: '::tgammal' has not been declared
using ::tgammal;
^~~~~~~
/usr/include/c++/7/cmath:1222:11: error: '::trunc' has not been declared
using ::trunc;
^~~~~
/usr/include/c++/7/cmath:1223:11: error: '::truncf' has not been declared
using ::truncf;
^~~~~~
/usr/include/c++/7/cmath:1224:11: error: '::truncl' has not been declared
using ::truncl;
^~~~~~
In file included from /usr/include/c++/7/bits/specfun.h:49:0,
from /usr/include/c++/7/cmath:1914,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:41,
from aliens.cpp:2:
/usr/include/c++/7/tr1/gamma.tcc: In function '_Tp NSubtask1::std::__detail::__log_bincoef(unsigned int, unsigned int)':
/usr/include/c++/7/tr1/gamma.tcc:292:40: error: 'lgamma' is not a member of 'std'
_Tp __coeff = _GLIBCXX_MATH_NS::lgamma(_Tp(1 + __n))
^~~~~~
/usr/include/c++/7/tr1/gamma.tcc:292:40: note: suggested alternatives:
In file included from /usr/include/features.h:367:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:533,
from /usr/include/c++/7/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
from aliens.cpp:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:261:1: note: 'NSubtask1::lgamma'
__MATHCALL (lgamma,, (_Mdouble_));
^
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:41:0,
from aliens.cpp:2:
/usr/include/c++/7/cmath:1524:5: note: 'NSubtask1::std::lgamma'
lgamma(_Tp __x)
^~~~~~
In file included from /usr/include/c++/7/bits/specfun.h:49:0,
from /usr/include/c++/7/cmath:1914,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:41,
from aliens.cpp:2:
/usr/include/c++/7/tr1/gamma.tcc:293:39: error: 'lgamma' is not a member of 'std'
- _GLIBCXX_MATH_NS::lgamma(_Tp(1 + __k))
^~~~~~
/usr/include/c++/7/tr1/gamma.tcc:293:39: note: suggested alternatives:
In file included from /usr/include/features.h:367:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:533,
from /usr/include/c++/7/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
from aliens.cpp:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:261:1: note: 'NSubtask1::lgamma'
__MATHCALL (lgamma,, (_Mdouble_));
^
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:41:0,
from aliens.cpp:2:
/usr/include/c++/7/cmath:1524:5: note: 'NSubtask1::std::lgamma'
lgamma(_Tp __x)
^~~~~~
In file included from /usr/include/c++/7/bits/specfun.h:49:0,
from /usr/include/c++/7/cmath:1914,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:41,
from aliens.cpp:2:
/usr/include/c++/7/tr1/gamma.tcc:294:39: error: 'lgamma' is not a member of 'std'
- _GLIBCXX_MATH_NS::lgamma(_Tp(1 + __n - __k));
^~~~~~