QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#296074 | #1418. Mountain Rescue Team | 17 | 0 | 1ms | 4092kb | C++20 | 4.4kb | 2024-01-02 07:36:51 | 2024-01-02 07:36:52 |
answer
#include <bits/stdc++.h>
using namespace std;
#include "grader.h"
bool g = false;
map<pair<int, int>, int> m;
template<class F>
vector<int> smawk(int h, int w, F f){
auto dfs = [&](auto self, vector<int> &row, vector<int> &col) -> vector<int>{
int n = row.size();
if(n == 0) return {};
vector<int> ncol;
ncol.reserve(n);
for(int i:col){
int mi = 2e9, ma = -2e9;
for(int j = 0; j < 10; j++){
for(int k = 0; k < 10; k++){
auto p = f(row[ncol.size()-1]-j, i+k, 1);
if(m.count({p/1000, p%1000})) ma = max(ma, m[{p/1000, p%1000}]);
}
}
if(ma == -2e9) ma = 2e9;
for(int j = 0; j < 10; j++){
for(int k = 0; k < 10; k++){
auto p = f(row[ncol.size()-1]+j, ncol.back()-k, 1);
if(m.count({p/1000, p%1000})) mi = min(mi, m[{p/1000, p%1000}]);
}
}
if(mi == 2e9) mi = -2e9;
while(!ncol.empty() && i != ncol.back() && ma > mi && f(row[ncol.size()-1], ncol.back()) > f(row[ncol.size()-1], i)) ncol.pop_back();
if(ncol.size() < n) ncol.push_back(i);
}
vector<int> row_odd;
row_odd.reserve(n/2+1);
for(int i = 1; i < n; i+=2) row_odd.push_back(row[i]);
vector<int> ans = self(self, row_odd, ncol);
vector<int> res(n);
for(int i = 0; i < row_odd.size(); i++) res[i*2+1] = ans[i];
int j = 0;
for(int i = 0; i < n; i+=2){
int last = (i == n-1 ? ncol.back() : res[i+1]);
res[i] = ncol[j];
while(ncol[j] < last){
++j;
if(f(row[i], res[i]) > f(row[i], ncol[j])) res[i] = ncol[j];
}
}
return res;
};
vector<int> row(h), col(w);
iota(row.begin(), row.end(), 0);
iota(col.begin(), col.end(), 0);
return dfs(dfs, row, col);
}
void Rescue(int R, int C, int RS, int CS, int X){
int l1 = 0, r1 = RS;
while(r1-l1 > 1){
int mid = (l1+r1)/2;
int x = mid, y = CS;
int h = m.count({x, y}) ? m[{x, y}] : Measure(x, y);
if(!m.count({x, y})){
if(h == X){
Pinpoint(x, y);
g = true;
}
m[{x, y}] = h;
}
if(h < X) l1 = mid;
else r1 = mid;
}
int l2 = RS, r2 = R+1;
while(r2-l2 > 1){
int mid = (l2+r2)/2;
int x = mid, y = CS;
int h = m.count({x, y}) ? m[{x, y}] : Measure(x, y);
if(!m.count({x, y})){
if(h == X){
Pinpoint(x, y);
g = true;
}
m[{x, y}] = h;
}
if(h < X) r2 = mid;
else l2 = mid;
}
auto f1 = [&](int x, int y, bool t = false){
x = r1+x;
y = CS-y;
if(t) return x*1000+y;
if(g) return 0;
int h = m.count({x, y}) ? m[{x, y}] : Measure(x, y);
if(!m.count({x, y})){
if(h == X){
Pinpoint(x, y);
g = true;
}
m[{x, y}] = h;
}
return abs(h-X);
};
auto s1 = smawk(RS-r1+1, CS, f1);
for(int i = 0; i < s1.size(); i++){
cerr << s1[i] << " ";
f1(i, s1[i]);
}
cerr << endl;
auto f2 = [&](int x, int y, bool t = false){
x = r1+x;
y = CS+y;
if(t) return x*1000+y;
if(g) return 0;
int h = m.count({x, y}) ? m[{x, y}] : Measure(x, y);
if(!m.count({x, y})){
if(h == X){
Pinpoint(x, y);
g = true;
}
m[{x, y}] = h;
}
return abs(h-X);
};
auto s2 = smawk(RS-r1+1, C-CS+1, f2);
for(int i = 0; i < s2.size(); i++){
cerr << s2[i] << " ";
f2(i, s2[i]);
}
cerr << endl;
auto f3 = [&](int x, int y, bool t = false){
x = l2-x;
y = CS-y;
if(t) return x*1000+y;
if(g) return 0;
int h = m.count({x, y}) ? m[{x, y}] : Measure(x, y);
if(!m.count({x, y})){
if(h == X){
Pinpoint(x, y);
g = true;
}
m[{x, y}] = h;
}
return abs(h-X);
};
auto s3 = smawk(l2-RS+1, CS, f3);
for(int i = 0; i < s3.size(); i++){
cerr << s3[i] << " ";
f3(i, s3[i]);
}
cerr << endl;
auto f4 = [&](int x, int y, bool t = false){
x = l2-x;
y = CS+y;
if(t) return x*1000+y;
if(g) return 0;
int h = m.count({x, y}) ? m[{x, y}] : Measure(x, y);
if(!m.count({x, y})){
if(h == X){
Pinpoint(x, y);
g = true;
}
m[{x, y}] = h;
}
return abs(h-X);
};
auto s4 = smawk(l2-RS+1, C-CS+1, f4);
for(int i = 0; i < s4.size(); i++){
cerr << s4[i] << " ";
f4(i, s4[i]);
}
cerr << endl;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Runtime Error
Test #1:
score: 20
Accepted
time: 0ms
memory: 4032kb
input:
1 1 1 1 1 1
output:
Accepted
Test #2:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
2 2 2 2 1 1 2 3 4
output:
Accepted
Test #3:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
2 2 2 2 2 1 2 3 4
output:
Accepted
Test #4:
score: 0
Accepted
time: 0ms
memory: 4036kb
input:
2 2 2 2 3 1 2 3 4
output:
Accepted
Test #5:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
2 2 2 2 4 1 2 3 4
output:
Accepted
Test #6:
score: 0
Accepted
time: 0ms
memory: 4040kb
input:
2 2 2 2 1 1 3 2 4
output:
Accepted
Test #7:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
2 2 2 2 3 1 3 2 4
output:
Accepted
Test #8:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
2 2 2 2 2 1 3 2 4
output:
Accepted
Test #9:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
2 2 2 2 4 1 3 2 4
output:
Accepted
Test #10:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
2 2 2 1 2 2 1 4 3
output:
Accepted
Test #11:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
2 2 2 1 1 2 1 4 3
output:
Accepted
Test #12:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
2 2 2 1 4 2 1 4 3
output:
Accepted
Test #13:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
2 2 2 1 3 2 1 4 3
output:
Accepted
Test #14:
score: 0
Accepted
time: 0ms
memory: 4028kb
input:
2 2 1 2 2 2 4 1 3
output:
Accepted
Test #15:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
2 2 1 2 4 2 4 1 3
output:
Accepted
Test #16:
score: 0
Accepted
time: 0ms
memory: 4048kb
input:
2 2 1 2 1 2 4 1 3
output:
Accepted
Test #17:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
2 2 1 2 3 2 4 1 3
output:
Accepted
Test #18:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
2 2 2 1 3 3 1 4 2
output:
Accepted
Test #19:
score: 0
Accepted
time: 0ms
memory: 4044kb
input:
2 2 2 1 1 3 1 4 2
output:
Accepted
Test #20:
score: 0
Accepted
time: 0ms
memory: 4000kb
input:
2 2 2 1 4 3 1 4 2
output:
Accepted
Test #21:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
2 2 2 1 2 3 1 4 2
output:
Accepted
Test #22:
score: 0
Accepted
time: 0ms
memory: 4032kb
input:
2 2 1 2 3 3 4 1 2
output:
Accepted
Test #23:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
2 2 1 2 4 3 4 1 2
output:
Accepted
Test #24:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
2 2 1 2 1 3 4 1 2
output:
Accepted
Test #25:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
2 2 1 2 2 3 4 1 2
output:
Accepted
Test #26:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
2 2 1 1 4 4 2 3 1
output:
Accepted
Test #27:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
2 2 1 1 2 4 2 3 1
output:
Accepted
Test #28:
score: 0
Accepted
time: 0ms
memory: 4032kb
input:
2 2 1 1 3 4 2 3 1
output:
Accepted
Test #29:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
2 2 1 1 1 4 2 3 1
output:
Accepted
Test #30:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
2 2 1 1 4 4 3 2 1
output:
Accepted
Test #31:
score: 0
Accepted
time: 0ms
memory: 4040kb
input:
2 2 1 1 3 4 3 2 1
output:
Accepted
Test #32:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
2 2 1 1 2 4 3 2 1
output:
Accepted
Test #33:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
2 2 1 1 1 4 3 2 1
output:
Accepted
Test #34:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
2 3 2 3 1 1 2 3 4 5 6
output:
Accepted
Test #35:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
2 3 2 3 4 1 2 4 3 5 6
output:
Accepted
Test #36:
score: 0
Accepted
time: 0ms
memory: 4044kb
input:
2 3 2 3 6 1 2 5 3 4 6
output:
Accepted
Test #37:
score: 0
Accepted
time: 0ms
memory: 4048kb
input:
2 3 2 2 5 1 3 2 4 6 5
output:
Accepted
Test #38:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
2 3 2 2 2 1 3 2 5 6 4
output:
Accepted
Test #39:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
2 3 2 3 5 1 3 4 2 5 6
output:
Accepted
Test #40:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
2 3 2 3 1 1 3 5 2 4 6
output:
Accepted
Test #41:
score: 0
Accepted
time: 0ms
memory: 4036kb
input:
2 3 2 2 2 1 4 2 3 6 5
output:
Accepted
Test #42:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
2 3 2 2 5 1 4 2 5 6 3
output:
Accepted
Test #43:
score: 0
Accepted
time: 0ms
memory: 3996kb
input:
2 3 2 2 5 1 4 3 2 6 5
output:
Accepted
Test #44:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
2 3 2 2 1 1 5 2 3 6 4
output:
Accepted
Test #45:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
2 3 2 2 2 1 5 2 4 6 3
output:
Accepted
Test #46:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
2 3 2 2 2 1 5 3 2 6 4
output:
Accepted
Test #47:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
2 3 2 2 6 2 3 1 4 6 5
output:
Accepted
Test #48:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
2 3 2 2 4 2 3 1 5 6 4
output:
Accepted
Test #49:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
2 3 2 2 6 2 4 1 3 6 5
output:
Accepted
Test #50:
score: 0
Accepted
time: 0ms
memory: 4068kb
input:
2 3 2 2 4 2 4 1 5 6 3
output:
Accepted
Test #51:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
2 3 1 3 1 2 4 6 1 3 5
output:
Accepted
Test #52:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
2 3 2 2 3 2 5 1 3 6 4
output:
Accepted
Test #53:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
2 3 2 2 4 2 5 1 4 6 3
output:
Accepted
Test #54:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
2 3 1 3 2 2 5 6 1 3 4
output:
Accepted
Test #55:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
2 3 1 2 6 2 6 4 1 5 3
output:
Accepted
Test #56:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
2 3 1 2 3 2 6 5 1 4 3
output:
Accepted
Test #57:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
2 3 2 1 3 3 2 1 6 5 4
output:
Accepted
Test #58:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
2 3 2 2 1 3 4 1 5 6 2
output:
Accepted
Test #59:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
2 3 1 3 1 3 4 6 1 2 5
output:
Accepted
Test #60:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
2 3 2 2 4 3 5 1 4 6 2
output:
Accepted
Test #61:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
2 3 1 3 4 3 5 6 1 2 4
output:
Accepted
Test #62:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
2 3 1 2 2 3 6 4 1 5 2
output:
Accepted
Test #63:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
2 3 1 2 4 3 6 4 2 5 1
output:
Accepted
Test #64:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
2 3 1 2 5 3 6 5 1 4 2
output:
Accepted
Test #65:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
2 3 1 2 6 3 6 5 2 4 1
output:
Accepted
Test #66:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
2 3 2 1 1 4 2 1 6 5 3
output:
Accepted
Test #67:
score: 0
Accepted
time: 0ms
memory: 4000kb
input:
2 3 2 1 4 4 3 1 6 5 2
output:
Accepted
Test #68:
score: 0
Accepted
time: 0ms
memory: 4048kb
input:
2 3 1 3 1 4 5 6 1 2 3
output:
Accepted
Test #69:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
2 3 1 2 6 4 6 2 3 5 1
output:
Accepted
Test #70:
score: 0
Accepted
time: 1ms
memory: 4040kb
input:
2 3 1 2 5 4 6 3 1 5 2
output:
Accepted
Test #71:
score: 0
Accepted
time: 0ms
memory: 4044kb
input:
2 3 1 2 1 4 6 3 2 5 1
output:
Accepted
Test #72:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
2 3 1 2 2 4 6 5 1 3 2
output:
Accepted
Test #73:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
2 3 1 2 2 4 6 5 2 3 1
output:
Accepted
Test #74:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
2 3 2 1 3 5 2 1 6 4 3
output:
Accepted
Test #75:
score: 0
Accepted
time: 0ms
memory: 4032kb
input:
2 3 2 1 1 5 3 1 6 4 2
output:
Accepted
Test #76:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
2 3 1 2 2 5 6 2 3 4 1
output:
Accepted
Test #77:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
2 3 1 2 3 5 6 3 1 4 2
output:
Accepted
Test #78:
score: 0
Accepted
time: 0ms
memory: 4012kb
input:
2 3 1 2 1 5 6 3 2 4 1
output:
Accepted
Test #79:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
2 3 1 2 3 5 6 4 1 3 2
output:
Accepted
Test #80:
score: 0
Accepted
time: 0ms
memory: 4048kb
input:
2 3 1 2 1 5 6 4 2 3 1
output:
Accepted
Test #81:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
2 3 1 1 5 6 4 2 5 3 1
output:
Accepted
Test #82:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
2 3 1 1 2 6 4 3 5 2 1
output:
Accepted
Test #83:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
2 3 1 1 6 6 5 2 4 3 1
output:
Accepted
Test #84:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
2 3 1 1 3 6 5 3 4 2 1
output:
Accepted
Test #85:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
2 3 1 1 1 6 5 4 3 2 1
output:
Accepted
Test #86:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
1 3 1 3 1 1 2 3
output:
Accepted
Test #87:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
1 3 1 3 2 1 2 3
output:
Accepted
Test #88:
score: 0
Accepted
time: 0ms
memory: 4048kb
input:
1 3 1 3 3 1 2 3
output:
Accepted
Test #89:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
1 3 1 2 1 1 3 2
output:
Accepted
Test #90:
score: 0
Accepted
time: 0ms
memory: 4028kb
input:
1 3 1 2 3 1 3 2
output:
Accepted
Test #91:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
1 3 1 2 2 1 3 2
output:
Accepted
Test #92:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
1 3 1 2 2 2 3 1
output:
Accepted
Test #93:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
1 3 1 2 3 2 3 1
output:
Accepted
Test #94:
score: 0
Accepted
time: 0ms
memory: 4048kb
input:
1 3 1 2 1 2 3 1
output:
Accepted
Test #95:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
1 3 1 1 3 3 2 1
output:
Accepted
Test #96:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
1 3 1 1 2 3 2 1
output:
Accepted
Test #97:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
1 3 1 1 1 3 2 1
output:
Accepted
Test #98:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
50 50 25 25 951985666 44544131 91526867 92591638 92602827 92850682 94092196 94130437 94362739 95149431 95201023 95299737 95530146 95703930 95830638 96161652 96177425 96283355 96288537 105014073 105460298 105598741 105699224 106604830 107427962 173165535 108162651 103558891 103356567 101280031 534453...
output:
Accepted
Test #99:
score: 0
Accepted
time: 1ms
memory: 4084kb
input:
50 50 30 12 239615691 198970964 199588589 199827654 200750902 219606923 219768101 222958140 223147594 223617302 223840190 224107231 245397142 222507248 222238595 222148187 221502142 221355250 219019842 218910785 218657961 218456225 217727973 216183279 215567159 215528232 214995079 214744415 21399096...
output:
Accepted
Test #100:
score: 0
Accepted
time: 1ms
memory: 3860kb
input:
50 50 41 13 21803182 21803182 22640351 22822628 22842035 22894975 23150927 23421190 23742395 23950017 24530562 25184421 25554044 45850484 25366183 18819607 18078058 17557430 17211437 15920791 15757714 15518704 14686158 14175620 13414990 10725176 10590825 10305600 10052365 9972543 9859843 7873899 785...
output:
Accepted
Test #101:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
50 50 20 8 155056 574571250 574961349 575153304 575306256 575577263 576237809 582465605 639397201 604785755 604146421 604142642 603393114 594955832 594879019 594155040 593760771 593512097 592047416 591879184 572604250 571653755 571388761 571051562 568870211 568487436 567614176 559687456 533016609 51...
output:
Accepted
Test #102:
score: 0
Accepted
time: 1ms
memory: 4064kb
input:
50 50 45 25 999935938 7609752 7625163 7631120 7878829 7951071 8115401 8131117 8497608 9039215 9224294 9545277 9732654 9998969 10078344 10290169 10828976 10938478 11412418 11585381 11963084 13205216 14002190 14052095 14534900 34083989 14250584 13979860 13554720 13449661 8746380 7361264 6164259 577670...
output:
Accepted
Test #103:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
50 50 31 38 999951647 872078 18973042 43219086 63568679 88731838 112115467 131240645 154128740 154176986 154266884 154365830 154417339 154883906 155740428 156315677 156333038 156737527 161178571 162439790 162741773 163220742 163239731 164028924 164407541 164780430 164955926 165024878 165659528 16624...
output:
Accepted
Test #104:
score: 0
Accepted
time: 1ms
memory: 3884kb
input:
50 50 7 44 64599154 21642435 38271797 112724551 144785354 159618984 191818396 231314431 300812849 329090530 370154405 403175303 426954055 452992650 463720673 509222750 542006366 566038003 594205567 597363505 623893190 656051812 678631090 689778812 715870784 750079406 755618380 788154928 803575753 81...
output:
Accepted
Test #105:
score: 0
Accepted
time: 1ms
memory: 3864kb
input:
50 50 41 22 172222921 7382853 7503025 7610120 7789954 7836682 8853403 8892346 9096363 9436411 9688423 10032917 10184925 10366779 11027720 11129919 11529605 12148261 12306474 12644449 13111403 13652119 41353415 15004614 14239747 14050527 13827966 13690870 7064271 6198168 6063250 6005901 5456624 54186...
output:
Accepted
Test #106:
score: 0
Accepted
time: 1ms
memory: 3872kb
input:
50 50 31 2 630623201 361829280 418097118 386181026 385682843 385592387 382603632 382171803 377375746 377251507 377013308 376948433 374017779 373782784 373526744 373467935 373337812 373034238 372709329 372218110 372104991 371882340 371479168 371194683 370939760 370846939 370736406 370524379 370089327...
output:
Accepted
Test #107:
score: 0
Accepted
time: 1ms
memory: 3856kb
input:
50 50 27 19 945960322 107983758 108369608 108906082 119505890 120782483 121591595 121804196 122041643 122060711 122411601 122449151 122468080 123218730 134130675 134994241 135156033 135156974 135399433 164900365 136678432 136441239 135788663 134927943 126645805 126479405 125562085 125092136 12490003...
output:
Accepted
Test #108:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
50 50 1 1 74151489 999609053 999427876 998174897 996657364 995097130 991506340 986553050 981950004 978453000 969110126 961168236 955958045 947768897 935538728 929010432 920319907 905125983 892462966 871901666 858585571 841874604 825222409 813681977 800074444 782572018 763530096 740689357 720553313 6...
output:
Accepted
Test #109:
score: 0
Accepted
time: 1ms
memory: 4092kb
input:
50 50 1 1 817076 999442754 998385728 996598818 995234042 994701346 992159867 988458314 986293841 980523802 974034681 963827720 955576001 946670476 939209020 927529855 922573764 912092988 897437654 884939017 869090147 851776325 837146237 825917123 807395100 795504941 781189629 756917817 735408790 707...
output:
Accepted
Test #110:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
50 50 50 50 37137055 356142 9286596 10406533 10677699 10817578 10886601 11296437 11370283 12867319 13896530 26071652 26317350 26485534 26825632 26857116 27783648 27889829 28357026 28499822 28573363 29616393 29717810 29824731 30602099 31315907 31334806 31710745 31739570 32004671 32015471 32261751 322...
output:
Accepted
Test #111:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
50 50 50 50 244717 244717 11852143 12249478 12310754 12699277 13098057 13598275 13875402 14320613 14337307 14502515 15158325 15436689 15953636 16060414 16123294 16401909 16696489 16702362 16950809 17235853 17309680 17350958 17578858 17749291 17758160 17806002 18599588 18852895 19090822 20496916 2063...
output:
Accepted
Test #112:
score: 0
Accepted
time: 1ms
memory: 3860kb
input:
50 50 1 50 108125183 69545237 108178399 135974614 178621204 213615496 256605544 294248678 332222572 363128778 397516484 430598455 460285707 491818514 513661337 541886025 567248989 590130647 615431522 641951026 664353983 683813118 695742893 725361065 742929129 761378385 778452808 795267779 815140137 ...
output:
Accepted
Test #113:
score: 0
Accepted
time: 1ms
memory: 3844kb
input:
50 50 1 50 317894 76528013 115626424 163743895 197181898 231252223 267928982 293612154 328354634 357473243 389807050 416942810 449206178 472829758 501789299 529184297 557130006 588238557 616712855 639287098 664928627 683865638 706204115 731018297 748330468 761888986 786292411 802648740 825656126 842...
output:
Accepted
Test #114:
score: 0
Accepted
time: 1ms
memory: 4080kb
input:
50 50 50 1 39569954 82407849 41648402 41261452 40696045 40175766 40071400 25042733 24504306 24480937 24045745 24019817 23805132 23193581 23062925 23011469 22560275 21950200 20860459 20581553 20204690 20190381 19304461 19280530 19197119 19111563 18668422 18304735 18141972 16746523 16430448 15190511 1...
output:
Accepted
Test #115:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
50 50 50 1 750911 72838504 36190804 35399778 35179334 34960854 34695247 34420165 34002616 33749492 33170131 33117502 32823566 32188298 31594526 31378396 31018884 30919527 29453381 28953382 28115822 28066205 28017839 27748135 27302823 27012095 26799236 26773136 26324614 26175546 26006100 24462825 244...
output:
Accepted
Test #116:
score: 0
Accepted
time: 1ms
memory: 3792kb
input:
50 50 25 50 980382992 448354 20407125 50410541 67944688 84480177 99313247 127478567 153156382 166652223 182095890 196234273 222209995 242705960 262377812 283596302 292448983 315829192 333572488 353189446 373546898 396345831 423087476 441314861 461450129 503097940 513142970 532151880 532713643 532870...
output:
Accepted
Test #117:
score: 0
Accepted
time: 1ms
memory: 4064kb
input:
50 50 50 25 59755862 14700979 15102364 15219537 15826552 15877599 16498063 16930197 16999885 17106399 17237536 18251611 18787663 18961417 19505817 19620064 19718852 19850365 19886838 20320484 20758804 20997660 21529015 22665984 22967881 44674241 14361370 14322890 13005570 12888155 12707974 12485436 ...
output:
Accepted
Test #118:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
1 50 1 50 42230506 42230506 55128319 65340093 114610664 138718450 207917151 210893593 211240113 244908523 315789147 348049618 361866095 371885953 381401083 409275860 471625499 487059354 525539376 531040079 561897527 562985720 571298388 586468518 624329625 647832840 653967292 693837485 702892895 7068...
output:
Accepted
Test #119:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
1 50 1 50 634567935 46849593 83402330 104306494 104442532 134704802 167543801 179142389 181180418 193426703 206285405 215352586 219797271 237732831 278480881 304666790 319991661 327860511 367015786 409558977 477702191 489989808 499028964 525648688 534717581 538381438 540678733 546056295 625558513 63...
output:
Accepted
Test #120:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
1 50 1 50 996100886 16967584 48140976 49006030 73147388 88059446 98578200 123657548 135664971 141633406 156384551 186136461 192857556 212349827 243288827 262833403 299180607 335055436 337354563 339522833 367315355 419001546 433295152 434856476 435561019 445467909 476516076 477821810 495829026 504587...
output:
Accepted
Test #121:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
50 1 50 1 55532192 55532192 55545058 74706951 100598458 112793505 123409428 135940917 142181486 144257282 158230135 163835464 170988781 182752857 231160118 235188793 259304035 273898675 289930031 292035680 353373298 388237461 400983392 489538950 510484858 559464608 561492448 574926929 584256420 5871...
output:
Accepted
Test #122:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
50 1 50 1 547797520 38254633 55250015 90801115 106029819 118034479 137684564 144427938 151634820 157671696 197258273 224232366 253829171 291284023 325788722 401794871 402158196 409183592 448409589 460594881 462250111 467896768 476895906 486639157 547797520 551441653 598626180 607464278 621220282 625...
output:
Accepted
Test #123:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
50 1 50 1 971336438 37723731 72649198 73422563 74237493 120508538 125128444 129284518 147800751 188125486 195389522 224848948 228087661 257968521 258503562 293879503 323339895 332907443 360910812 374830909 376121080 382421477 407912357 415219479 467993306 469288649 469472630 501184015 508183757 5311...
output:
Accepted
Test #124:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
50 50 50 50 900002451 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 900000050 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 9...
output:
Accepted
Test #125:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
50 50 50 1 900002451 2402 2353 2304 2255 2206 2157 2108 2059 2010 1961 1912 1863 1814 1765 1716 1667 1618 1569 1520 1471 1422 1373 1324 1275 1226 1177 1128 1079 1030 981 932 883 834 785 736 687 638 589 540 491 442 393 344 295 246 197 148 99 50 1 2403 2354 2305 2256 2207 2158 2109 2060 2011 1962 1913...
output:
Accepted
Test #126:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
50 50 1 1 900002451 900002451 2450 2449 2448 2447 2446 2445 2444 2443 2442 2441 2440 2439 2438 2437 2436 2435 2434 2433 2432 2431 2430 2429 2428 2427 2426 2425 2424 2423 2422 2421 2420 2419 2418 2417 2416 2415 2414 2413 2412 2411 2410 2409 2408 2407 2406 2405 2404 2403 2402 900002402 2401 2400 2399 ...
output:
Accepted
Test #127:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
50 50 1 50 900002451 900000050 900000099 900000148 900000197 900000246 900000295 900000344 900000393 900000442 900000491 900000540 900000589 900000638 900000687 900000736 900000785 900000834 900000883 900000932 900000981 900001030 900001079 900001128 900001177 900001226 900001275 900001324 900001373...
output:
Accepted
Test #128:
score: -20
Runtime Error
input:
14 16 13 5 345853273 3628141 12987529 61846219 62180055 165524100 58701774 56602834 53710058 47073748 46286302 40741136 39427814 36396469 35012453 19529557 16459918 100768216 104749076 164286853 171061023 261468026 166647989 165848242 164051130 164023950 163007820 97948018 94446908 91054606 82235273...
output:
Unauthorized output
Subtask #2:
score: 0
Skipped
Dependency #1:
0%