Submission #1175188


Source Code Expand

#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <functional>
#include <set>
#include <ctime>
#include <random>
#include <chrono>
#include <cassert>
#include <tuple>
#include <utility>
using namespace std;

namespace {
  using Integer = long long; //__int128;
  template<class T, class S> istream& operator >> (istream& is, pair<T,S>& p){return is >> p.first >> p.second;}
  template<class T> istream& operator >> (istream& is, vector<T>& vec){for(T& val: vec) is >> val; return is;}
  template<class T> istream& operator ,  (istream& is, T& val){ return is >> val;}
  template<class T, class S> ostream& operator << (ostream& os, const pair<T,S>& p){return os << p.first << " " << p.second;}
  template<class T> ostream& operator << (ostream& os, const vector<T>& vec){for(size_t i=0; i<vec.size(); i++) os << vec[i] << (i==vec.size()-1?"":" "); return os;}
  template<class T> ostream& operator ,  (ostream& os, const T& val){ return os << " " << val;}

  template<class H> void print(const H& head){ cout << head; }
  template<class H, class ... T> void print(const H& head, const T& ... tail){ cout << head << " "; print(tail...); }
  template<class ... T> void println(const T& ... values){ print(values...); cout << endl; }

  template<class H> void eprint(const H& head){ cerr << head; }
  template<class H, class ... T> void eprint(const H& head, const T& ... tail){ cerr << head << " "; eprint(tail...); }
  template<class ... T> void eprintln(const T& ... values){ eprint(values...); cerr << endl; }

  class range{ Integer start_, end_, step_; public: struct range_iterator{ Integer val, step_; range_iterator(Integer v, Integer step) : val(v), step_(step) {} Integer operator * (){return val;} void operator ++ (){val += step_;} bool operator != (range_iterator& x){return step_ > 0 ? val < x.val : val > x.val;} }; range(Integer len) : start_(0), end_(len), step_(1) {} range(Integer start, Integer end) : start_(start), end_(end), step_(1) {} range(Integer start, Integer end, Integer step) : start_(start), end_(end), step_(step) {} range_iterator begin(){ return range_iterator(start_, step_); } range_iterator   end(){ return range_iterator(  end_, step_); } };

  inline string operator "" _s (const char* str, size_t size){ return move(string(str)); }
  constexpr Integer my_pow(Integer x, Integer k, Integer z=1){return k==0 ? z : k==1 ? z*x : (k&1) ? my_pow(x*x,k>>1,z*x) : my_pow(x*x,k>>1,z);}
  constexpr Integer my_pow_mod(Integer x, Integer k, Integer M, Integer z=1){return k==0 ? z%M : k==1 ? z*x%M : (k&1) ? my_pow_mod(x*x%M,k>>1,M,z*x%M) : my_pow_mod(x*x%M,k>>1,M,z);}
  constexpr unsigned long long operator "" _ten (unsigned long long value){ return my_pow(10,value); }

  inline int k_bit(Integer x, int k){return (x>>k)&1;} //0-indexed


  template<class T> string join(const vector<T>& v, const string& sep){ stringstream ss; for(size_t i=0; i<v.size(); i++){ if(i>0) ss << sep; ss << v[i]; } return ss.str(); }

  inline string operator * (string s, int k){ string ret; while(k){ if(k&1) ret += s; s += s; k >>= 1; } return ret; }
}
constexpr long long mod = 9_ten + 7;

class XorShift{
public:
  uint32_t x;
  uint32_t y;
  uint32_t z;
  uint32_t w;

  XorShift(){
    x = 123456789;
    y = 362436069;
    z = 521288629;
    w = 88675123;
  }
  
  XorShift(uint32_t seed){
    x = 123456789;
    y = 362436069;
    z = 521288629;
    w = seed;

    for(int i=0; i<100; i++){
      (*this)();
    }
  }
  
  uint32_t operator () () {
    uint32_t t = x ^ (x << 11);
    
    x = y; y = z; z = w;
    return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); 
  }
};

template<class T>
class Min_Cost_Flow{
public:

  struct edge{
    int to;
    int cap;
    T cost;
    int rev;
    bool is_rev;
  };

  const T INF;
  vector<vector<edge>> G;

  Min_Cost_Flow(int n, T inf) : G(n), INF(inf){

  }

  void add_edge(int from, int to, int cap, T cost){
    G[from].push_back((edge){to, cap, cost, (int)G[to].size(), false});
    G[to].push_back((edge){from, 0, -cost, (int)G[from].size()-1, true});
  }


  //min cost : s->t (flow:f)
  T min_cost_flow(int s, int t, int f){
    const int N = G.size();
    T cost = 0;
    vector<int> prev_v(N,-1);
    vector<int> prev_e(N,-1);
    vector<T> potantial(N, 0);

    
    while(f>0){
      //min distance(cost based) search with SPFA
      vector<T> dist(N, INF);
      
      vector<int> cnt(dist.size(), 0);
      dist[s] = 0;
      prev_v[s] = s;

      queue<int> Q;
      auto my_push = [&](int node){
        Q.push(node);
        cnt[node]++;
      };
      auto my_pop = [&]() -> int{
        int ret = Q.front();
        cnt[ret]--;
        Q.pop();
        return ret;
      };
      my_push(s);
      while(!Q.empty()){
        int pos = my_pop();
        for(int i=0; i<G[pos].size(); i++){
          edge& E = G[pos][i];
          T new_dist = dist[pos] + E.cost + potantial[E.to] - potantial[pos];
          if(dist[E.to] > new_dist && E.cap > 0){
            dist[E.to] = new_dist;
            prev_v[ E.to ] = pos;
            prev_e[ E.to ] = i;

            if(cnt[ E.to ] == 0){
              my_push( E.to );
            }
          }
        }
      }
      for(int i=0; i<N; i++){
        dist[i] = potantial[i] + dist[i];
      }

      //cannot achieved to "t" return -1
      if(dist[t]>=INF) return -1;

      //add cost of s->t with flow=d
      int pos=t;
      int d=f;
      while(pos!=s){
        int i=prev_v[pos];
        int j=prev_e[pos];
        pos = i;
        d = min(d, G[i][j].cap);
      }
      
      pos = t;
      //cout << t ;
      while(pos!=s){
        int i=prev_v[pos];
        int j=prev_e[pos];
        G[i][j].cap -= d;
        G[ G[i][j].to ][ G[i][j].rev ].cap += d;
        //cost += G[i][j].cost * d;
        pos = i;
        //cout << " <- " << pos;
      }
      //cout << endl;
      cost += d * dist[t];
      f -= d;

      //f==0 then end
    }
    return cost;
  }
};



constexpr int H = 30, W = 30;
constexpr int K = 450;
//constexpr int T=50;
/**
* パラメータ
*/
constexpr int T = 200;
constexpr int BeamWidth = 10;
constexpr int BeamNext = 2;
constexpr unsigned long long seed_mt = 1145148931919ll;
constexpr unsigned int seed_xor = 1919893;
mt19937_64 mt(seed_mt);
XorShift xrand(seed_xor);

constexpr int mask = 1<<20;
constexpr int threshold_move_good = mask * 0.95;
constexpr int threshold_move_bad = mask * 0.05;

long long calc_score( vector<pair<int,int>>& pos, vector<pair<int,int>>& target ){
  long long ret = 0;
  for(int i=0; i<pos.size(); i++){
    ret += abs( pos[i].first - target[i].first ) + abs( pos[i].second - target[i].second );
  }
  return ret;
}

struct state{
  vector<pair<int,int>> p;
  long long score;
  string move;
};

int dx[] = {0, 0, 1,-1};
int dy[] = {1,-1, 0, 0};
char dc[] = {'D','U','R','L'};

vector<string> gen_next_state(vector<pair<int,int>>& now, vector<pair<int,int>>& target){
  vector<string> res(2, string(now.size(), '-'));

  vector<pair<int,int>> s = now;

  vector<vector<int>> cell(H, vector<int>(W, -1));
  for(int i=0; i<s.size(); i++){
    int r,c;
    tie(r,c) = s[i];
    cell[r][c] = i;
  }

  vector<vector<bool>> used_cell(H, vector<bool>(W, false));

  vector<bool> used(now.size(), false);

  vector<int> value(now.size(), 0);
  for(int i=0; i<s.size(); i++){
    //value[i] += abs(target[i].first - 15) + abs(target[i].second - 15);
    value[i] += abs(target[i].first - now[i].second) + abs(target[i].second - now[i].second);
    value[i] += xrand()&63;
  }

  vector<int> order(now.size());
  iota(order.begin(), order.end(), 0);
  if( xrand()&255 < 100){
    shuffle(order.begin(), order.end(), mt);
  }else{
    sort(order.begin(), order.end(), [&](int l, int r){
      return value[l] > value[r];
    });
  }

  for(int i : order){
    if(used[i]) continue;
    int dy = target[i].first - now[i].first;
    int dx = target[i].second - now[i].second;

    int r = now[i].first;
    int c = now[i].second;
    vector<int> rr = {-1,-1,-1, 0,0,0, 1,1,1};
    for(auto& y:rr) y+=r;

    vector<int> cc = {-1,0,1, -1,0,1, -1,0,1,};
    for(auto& x:cc) x+=c;

    if(abs(dx) > abs(dy)){
      if(dx < 0){ // left
        if( rr[0] >= 0 && !used_cell[rr[1]][cc[1]] && !used_cell[rr[3]][cc[3]] && !used[cell[rr[0]][cc[0]]] ){
          //01 34
          int a = cell[rr[0]][cc[0]];
          used[a] = true;
          used[i] = true;
          used_cell[ rr[1] ][ cc[1] ] = used_cell[ rr[3] ][ cc[3] ] = true;
          res[0][i] = 'U';
          res[1][i] = 'L';

          res[0][a] = 'D';
          res[1][a] = 'R';

          swap( s[a], s[i] );
        }else if( rr[6] < H && !used_cell[rr[3]][cc[3]] && !used_cell[rr[7]][cc[7]] && !used[cell[rr[6]][cc[6]]] ){
          //34 67
          int a = cell[rr[6]][cc[6]];
          used[a] = true;
          used[i] = true;
          used_cell[ rr[7] ][ cc[7] ] = used_cell[ rr[3] ][ cc[3] ] = true;
          res[0][i] = 'L';
          res[1][i] = 'D';

          res[0][a] = 'R';
          res[1][a] = 'U';

          swap( s[a], s[i] );
        }
      }else if(dx > 0){
        if( rr[0] >= 0 && !used_cell[rr[1]][cc[1]] && !used_cell[rr[5]][cc[5]] && !used[cell[rr[2]][cc[2]]] ){
          //12 45
          int a = cell[rr[2]][cc[2]];
          used[a] = true;
          used[i] = true;
          used_cell[ rr[1] ][ cc[1] ] = used_cell[ rr[5] ][ cc[5] ] = true;
          res[0][i] = 'R';
          res[1][i] = 'U';

          res[0][a] = 'L';
          res[1][a] = 'D';

          swap( s[a], s[i] );
        }else if( rr[6] < H && !used_cell[rr[5]][cc[5]] && !used_cell[rr[7]][cc[7]] && !used[cell[rr[8]][cc[8]]] ){
          //45 78
          int a = cell[rr[8]][cc[8]];
          used[a] = true;
          used[i] = true;
          used_cell[ rr[5] ][ cc[5] ] = used_cell[ rr[7] ][ cc[7] ] = true;
          res[0][i] = 'D';
          res[1][i] = 'R';

          res[0][a] = 'U';
          res[1][a] = 'L';

          swap( s[a], s[i] );
        }
      }
    }else{
      if(dy < 0){ // up
        if( cc[0] >= 0 && !used_cell[rr[1]][cc[1]] && !used_cell[rr[3]][cc[3]] && !used[cell[rr[0]][cc[0]]] ){
          //01 34
          int a = cell[rr[0]][cc[0]];
          used[a] = true;
          used[i] = true;
          used_cell[ rr[1] ][ cc[1] ] = used_cell[ rr[3] ][ cc[3] ] = true;
          res[0][i] = 'U';
          res[1][i] = 'L';

          res[0][a] = 'D';
          res[1][a] = 'R';

          swap( s[a], s[i] );
        }else if( cc[2] < W && !used_cell[rr[1]][cc[1]] && !used_cell[rr[5]][cc[5]] && !used[cell[rr[2]][cc[2]]] ){
          //12 45
          int a = cell[rr[2]][cc[2]];
          used[a] = true;
          used[i] = true;
          used_cell[ rr[1] ][ cc[1] ] = used_cell[ rr[5] ][ cc[5] ] = true;
          res[0][i] = 'R';
          res[1][i] = 'U';

          res[0][a] = 'L';
          res[1][a] = 'D';

          swap( s[a], s[i] );
        }
      }else if(dy > 0){
        if( cc[6] >= 0 && !used_cell[rr[3]][cc[3]] && !used_cell[rr[7]][cc[7]] && !used[cell[rr[6]][cc[6]]] ){
          //34 67
          int a = cell[rr[6]][cc[6]];
          used[a] = true;
          used[i] = true;
          used_cell[ rr[7] ][ cc[7] ] = used_cell[ rr[3] ][ cc[3] ] = true;
          res[0][i] = 'L';
          res[1][i] = 'D';

          res[0][a] = 'R';
          res[1][a] = 'U';

          swap( s[a], s[i] );
        }
        else if( cc[8] < W && !used_cell[rr[5]][cc[5]] && !used_cell[rr[7]][cc[7]] && !used[cell[rr[8]][cc[8]]] ){
          //45 78
          int a = cell[rr[8]][cc[8]];
          used[a] = true;
          used[i] = true;
          used_cell[ rr[5] ][ cc[5] ] = used_cell[ rr[7] ][ cc[7] ] = true;
          res[0][i] = 'D';
          res[1][i] = 'R';

          res[0][a] = 'U';
          res[1][a] = 'L';

          swap( s[a], s[i] );
        }
      }
    }
  }

  now = s;
  return res;
}


long long calc_actual_score(int L, vector<pair<int,int>>& s, vector<pair<int,int>>& t){
  long long pd = 20 + calc_score(s,t);
  double pt = 10 + L * 0.01;

  return ceil( 1e7 / (pd*pt) );
}


vector<string> adjust_state(vector<pair<int,int>>& p, vector<pair<int,int>>& target){
  vector<string> res;
  int k = p.size();
  for(int t : range(2)){
    int source = H*W + 0;
    int sink   = H*W + 1;
    Min_Cost_Flow<int> f(H*W + 2, 1e8);

    vector<vector<int>> cell(H, vector<int>(W, -1));
    for(int i=0; i<k; i++){
      int r,c;
      tie(r,c) = p[i];
      cell[r][c] = i;
      f.add_edge( source, r*W+c, 1, 0 );
    }

    for(int r=0; r<H; r++){
      for(int c=0; c<W; c++){
        if(cell[r][c] != -1){
          for(int j=0; j<4; j++){
            int rr = r + dy[j];
            int cc = c + dx[j];
            if( rr<0 || rr>=H || cc<0 || cc>=W ) continue;

            int i = cell[r][c];
            int score_prev = abs( r - target[i].first ) + abs( c - target[i].second );
            int score_next = abs( rr - target[i].first ) + abs( cc - target[i].second );
            f.add_edge( r*W + c, rr*W + cc, 1000, score_next - score_prev );
          }

        }else{
          f.add_edge(r*W+c, sink, 1, 0);
        }

      }
    }


    int cost = f.min_cost_flow(source, sink, k);
    if(cost == 0) break;

    string moving_(k, '-');
    auto next_cell = cell;

    for(int r=0; r<H; r++){
      for(int c=0; c<W; c++){
        int pos = r*W+c;
        if(cell[r][c] < 0) continue;
        for(auto e : f.G[pos] ){
          if( e.to == source || e.to == sink) continue;
          if( e.is_rev ) continue;
          if( e.cap == 1000 ) continue;
          int rr = e.to/W;
          int cc = e.to%W;

          if(cell[rr][cc] != -1) continue;
          cell[rr][cc] = -2;

          char m = '-';

          if(rr<r) m = 'U';
          if(rr>r) m = 'D';

          if(cc<c) m = 'L';
          if(cc>c) m = 'R';

          moving_[ cell[r][c] ] = m;

          p[ cell[r][c] ] = {rr,cc};
          break;
        }
      }
    }

    res.push_back( moving_ );

  }

  return res;
}


tuple<vector<pair<int,int>>, vector<string>> move_to_ichimatsu(vector<pair<int,int>> p){
  vector<string> res;
  int k = p.size();
  while(true){
    int source = H*W + 0;
    int sink   = H*W + 1;
    Min_Cost_Flow<int> f(H*W + 2, 1e8);

    vector<vector<int>> cell(H, vector<int>(W, -1));
    for(int i=0; i<k; i++){
      int r,c;
      tie(r,c) = p[i];
      cell[r][c] = i;
      f.add_edge( source, r*W+c, 1, 0 );
    }

    for(int r=0; r<H; r++){
      for(int c=0; c<W; c++){
        for(int j=0; j<4; j++){
          int rr = r + dy[j];
          int cc = c + dx[j];
          if( rr<0 || rr>=H || cc<0 || cc>=W ) continue;
          f.add_edge( r*W + c, rr*W + cc, 1000, 1);
        }

        if( ((r+c)&1) == 0 ){
          f.add_edge(r*W+c, sink, 1, 0);
        }
      }
    }


    int cost = f.min_cost_flow(source, sink, k);
    if(cost == 0) break;

    string moving_(k, '-');
    auto next_cell = cell;

    for(int r=0; r<H; r++){
      for(int c=0; c<W; c++){
        int pos = r*W+c;
        if(cell[r][c] < 0) continue;
        for(auto e : f.G[pos] ){
          if( e.to == source || e.to == sink) continue;
          if( e.is_rev ) continue;
          if( e.cap == 1000 ) continue;
          int rr = e.to/W;
          int cc = e.to%W;

          if(cell[rr][cc] != -1) continue;
          cell[rr][cc] = -2;

          char m = '-';

          if(rr<r) m = 'U';
          if(rr>r) m = 'D';

          if(cc<c) m = 'L';
          if(cc>c) m = 'R';

          moving_[ cell[r][c] ] = m;

          p[ cell[r][c] ] = {rr,cc};
          break;
        }
      }
    }

    res.push_back( moving_ );

  }

  return make_tuple(p, res);
}

#include <unordered_set>

int main(){
  int h,w,k,t;
  cin >> h,w,k,t;


  vector<vector<unsigned long long>> zobrist_hash(k, vector<unsigned long long>(h*w, 0));
  for(int i=0; i<k; i++){
    for(int r=0; r<H; r++){
      for(int c=0; c<W; c++){
        zobrist_hash[i][r*W+c] = mt();
      }
    }
  }


  vector<pair<int,int>> a(k),target(k);
  for(auto i : range(k) ){
    int ra, ca;
    cin >> ra, ca;
    a[i] = {ra-1,ca-1};

    int rt, ct;
    cin >> rt, ct;
    target[i] = {rt-1, ct-1};
  }

  //set initial position
  auto state_initial = move_to_ichimatsu(a);
  auto state_after   = move_to_ichimatsu(target);

  auto a_ = get<0>(state_initial);
  auto target_ = get<0>(state_after);

  vector<string> res = get<1>(state_initial);

  unordered_set<unsigned long long> memo;
  auto get_hash = [&](vector<pair<int,int>>& s){
    unsigned long long h = 0;
    for(int i=0; i<k; i++){
      h ^= zobrist_hash[ i ][ s[i].first*W + s[i].second ];
    }
    return h;
  };
  memo.insert( get_hash(a_) );

  bool last_adjust  = false;
  bool last_skipped = false;

  for(int step=0; step<10000; step++){
    auto prev_a = a_;
    vector<string> nx;

    int type = 0;
    if((last_adjust && last_skipped) == false &&
       step > 1 && step<8000 && (xrand()&127) < 45 /*&& calc_score( a_, target_ ) > 20*/
     ){
      nx = adjust_state( a_, target_ );
      type = 0;
    }else{
      nx = gen_next_state( a_, target_ );
      type = 1;
    }

    last_adjust = type==0;

    auto h = get_hash( a_ );
    // if(memo.count(h)){
    //   a_ = prev_a;
    //   last_skipped = true;
    //   continue;
    // }

    last_skipped = false;

    memo.insert(h);

    for(auto s : nx){
      res.push_back( s );
    }

    if(a_ == target_) break;
  }

  if(a_ == target_){
    vector<string> tmp = get<1>(state_after);
    reverse(tmp.begin(), tmp.end());
    for(auto& moving : tmp){
      for(auto& c : moving){
        if(c == 'U') c = 'D';
        else if(c == 'D') c = 'U';
        else if(c == 'L') c = 'R';
        else if(c == 'R') c = 'L';
      }
      res.push_back(moving);
    }
  }

  println( res.size() );
  println( join(res, "\n") );

  eprintln( res.size() );
  eprintln( calc_actual_score( res.size(), a_, target_) );

  return 0;
}

Submission Info

Submission Time
Task B - 日本橋大渋滞
User koyumeishi
Language C++14 (GCC 5.4.1)
Score 1233241
Code Size 18625 Byte
Status AC
Exec Time 2103 ms
Memory 4224 KB

Judge Result

Set Name test_01 test_02 test_03 test_04 test_05 test_06 test_07 test_08 test_09 test_10 test_11 test_12 test_13 test_14 test_15 test_16 test_17 test_18 test_19 test_20 test_21 test_22 test_23 test_24 test_25 test_26 test_27 test_28 test_29 test_30
Score / Max Score 41018 / 50000 42088 / 50000 41289 / 50000 40984 / 50000 41598 / 50000 39589 / 50000 40226 / 50000 39969 / 50000 42159 / 50000 40884 / 50000 41323 / 50000 41018 / 50000 41018 / 50000 42266 / 50000 41912 / 50000 41221 / 50000 41357 / 50000 41255 / 50000 40065 / 50000 42195 / 50000 40651 / 50000 41255 / 50000 41947 / 50000 40951 / 50000 40917 / 50000 41357 / 50000 42017 / 50000 40984 / 50000 38911 / 50000 40817 / 50000
Status
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
Set Name Test Cases
test_01 subtask_01_01.txt
test_02 subtask_01_02.txt
test_03 subtask_01_03.txt
test_04 subtask_01_04.txt
test_05 subtask_01_05.txt
test_06 subtask_01_06.txt
test_07 subtask_01_07.txt
test_08 subtask_01_08.txt
test_09 subtask_01_09.txt
test_10 subtask_01_10.txt
test_11 subtask_01_11.txt
test_12 subtask_01_12.txt
test_13 subtask_01_13.txt
test_14 subtask_01_14.txt
test_15 subtask_01_15.txt
test_16 subtask_01_16.txt
test_17 subtask_01_17.txt
test_18 subtask_01_18.txt
test_19 subtask_01_19.txt
test_20 subtask_01_20.txt
test_21 subtask_01_21.txt
test_22 subtask_01_22.txt
test_23 subtask_01_23.txt
test_24 subtask_01_24.txt
test_25 subtask_01_25.txt
test_26 subtask_01_26.txt
test_27 subtask_01_27.txt
test_28 subtask_01_28.txt
test_29 subtask_01_29.txt
test_30 subtask_01_30.txt
Case Name Status Exec Time Memory
subtask_01_01.txt AC 1924 ms 4224 KB
subtask_01_02.txt AC 1702 ms 3968 KB
subtask_01_03.txt AC 1832 ms 4096 KB
subtask_01_04.txt AC 1877 ms 3968 KB
subtask_01_05.txt AC 1774 ms 4092 KB
subtask_01_06.txt AC 2057 ms 3968 KB
subtask_01_07.txt AC 2013 ms 3968 KB
subtask_01_08.txt AC 2056 ms 3968 KB
subtask_01_09.txt AC 1733 ms 4096 KB
subtask_01_10.txt AC 1997 ms 4224 KB
subtask_01_11.txt AC 1756 ms 4096 KB
subtask_01_12.txt AC 1881 ms 4224 KB
subtask_01_13.txt AC 1896 ms 4224 KB
subtask_01_14.txt AC 1662 ms 3968 KB
subtask_01_15.txt AC 1725 ms 3968 KB
subtask_01_16.txt AC 1836 ms 3968 KB
subtask_01_17.txt AC 1759 ms 3968 KB
subtask_01_18.txt AC 1827 ms 4096 KB
subtask_01_19.txt AC 2074 ms 3968 KB
subtask_01_20.txt AC 1660 ms 3968 KB
subtask_01_21.txt AC 1924 ms 3968 KB
subtask_01_22.txt AC 1834 ms 4096 KB
subtask_01_23.txt AC 1716 ms 4096 KB
subtask_01_24.txt AC 1931 ms 3968 KB
subtask_01_25.txt AC 1951 ms 3968 KB
subtask_01_26.txt AC 1765 ms 4096 KB
subtask_01_27.txt AC 1686 ms 3968 KB
subtask_01_28.txt AC 1941 ms 3968 KB
subtask_01_29.txt AC 2103 ms 4224 KB
subtask_01_30.txt AC 1983 ms 3968 KB