Submission #337970


Source Code Expand

#ifndef KOMAKI_LOCAL
#define NDEBUG
#endif

#include <bits/stdc++.h>
#include <sys/time.h>
#include <unistd.h>
using namespace std;
#define i32         int32_t
#define rep(i, n)   for(i32 i = 0; i < ((i32)(n)); ++i)
#define sz(v)       ((i32)((v).size()))
#define bit(n)      (((i32)1)<<((i32)(n)))
#define all(v)      (v).begin(), (v).end()

std::string dbgDelim(int &i){ return (i++ == 0 ? "" : ", "); }
#define dbgEmbrace(exp) { int i = 0; os << "{"; { exp; } os << "}"; return os; }
template <class T> std::ostream& operator<<(std::ostream &os, std::vector<T> v);
template <class T> std::ostream& operator<<(std::ostream &os, std::set<T> v);
template <class T> std::ostream& operator<<(std::ostream &os, std::queue<T> q);
template <class T> std::ostream& operator<<(std::ostream &os, std::priority_queue<T> q);
template <class T, class K> std::ostream& operator<<(std::ostream &os, std::pair<T, K> p);
template <class T, class K> std::ostream& operator<<(std::ostream &os, std::map<T, K> mp);
template <class T, class K> std::ostream& operator<<(std::ostream &os, std::unordered_map<T, K> mp);
template <int INDEX, class TUPLE> void dbgDeploy(std::ostream &os, TUPLE tuple){}
template <int INDEX, class TUPLE, class H, class ...Ts> void dbgDeploy(std::ostream &os, TUPLE t)
{ os << (INDEX == 0 ? "" : ", ") << get<INDEX>(t); dbgDeploy<INDEX + 1, TUPLE, Ts...>(os, t); }
template <class T, class K> void dbgDeploy(std::ostream &os, std::pair<T, K> p, std::string delim)
{ os << "(" << p.first << delim << p.second << ")"; }
template <class ...Ts> std::ostream& operator<<(std::ostream &os, std::tuple<Ts...> t)
{ os << "("; dbgDeploy<0, std::tuple<Ts...>, Ts...>(os, t); os << ")"; return os; }
template <class T, class K> std::ostream& operator<<(std::ostream &os, std::pair<T, K> p)
{ dbgDeploy(os, p, ", "); return os; }
template <class T> std::ostream& operator<<(std::ostream &os, std::vector<T> v)
{ dbgEmbrace( for(T t: v){ os << dbgDelim(i) << t; }); }
template <class T> std::ostream& operator<<(std::ostream &os, std::set<T> s)
{ dbgEmbrace( for(T t: s){ os << dbgDelim(i) << t; }); }
template <class T> std::ostream& operator<<(std::ostream &os, std::queue<T> q)
{ dbgEmbrace( for(; q.size(); q.pop()){ os << dbgDelim(i) << q.front(); }); }
template <class T> std::ostream& operator<<(std::ostream &os, std::priority_queue<T> q)
{ dbgEmbrace( for(; q.size(); q.pop()){ os << dbgDelim(i) << q.top();   }); }
template <class T, class K> std::ostream& operator<<(std::ostream &os, std::map<T, K> mp)
{ dbgEmbrace( for(auto p: mp){ os << dbgDelim(i); dbgDeploy(os, p, "->"); }); }
template <class T, class K> std::ostream& operator<<(std::ostream &os, std::unordered_map<T, K> mp)
{ dbgEmbrace( for(auto p: mp){ os << dbgDelim(i); dbgDeploy(os, p, "->"); }); }
#define DBG_OUT std::cerr
#define DBG_OVERLOAD(_1, _2, _3, _4, _5, _6, macro_name, ...) macro_name
#define DBG_LINE() { char s[99]; sprintf(s, "line:%3d | ", __LINE__); DBG_OUT << s; }
#define DBG_OUTPUT(v) { DBG_OUT << (#v) << "=" << (v); }
#define DBG1(v, ...) { DBG_OUTPUT(v); }
#define DBG2(v, ...) { DBG_OUTPUT(v); DBG_OUT << ", "; DBG1(__VA_ARGS__); }
#define DBG3(v, ...) { DBG_OUTPUT(v); DBG_OUT << ", "; DBG2(__VA_ARGS__); }
#define DBG4(v, ...) { DBG_OUTPUT(v); DBG_OUT << ", "; DBG3(__VA_ARGS__); }
#define DBG5(v, ...) { DBG_OUTPUT(v); DBG_OUT << ", "; DBG4(__VA_ARGS__); }
#define DBG6(v, ...) { DBG_OUTPUT(v); DBG_OUT << ", "; DBG5(__VA_ARGS__); }

#define DEBUG0() { DBG_LINE(); DBG_OUT << std::endl; }
#define DEBUG(...)                                                      \
  {                                                                     \
    DBG_LINE();                                                         \
    DBG_OVERLOAD(__VA_ARGS__, DBG6, DBG5, DBG4, DBG3, DBG2, DBG1)(__VA_ARGS__); \
    DBG_OUT << std::endl;                                               \
  }









template <typename T> class PushRelabel
{
public:
  T maxFlow(int source, int target);
  void addEdge(int from, int dest, T capacity);
  
  PushRelabel(){}
  PushRelabel(int vertex_num) : vertex_num(vertex_num) {}

private:
  const int vertex_num;
  
  struct Node;
  struct CsrElement
  {
    Node *target;
    T capacity;
    CsrElement *reversed_edge;
    
    CsrElement(Node *target, T capacity, CsrElement *reversed_edge)
      : target(target), capacity(capacity), reversed_edge(reversed_edge) {}
  };
  CsrElement *csr;
  
  struct Node
  {
    int32_t height;
    T excess;
    CsrElement *first_csr_element;
    CsrElement *current_csr_element;
    
    Node *bucket_next;
    Node *bucket_prev;
  };
  
  struct Bucket
  {
    Node *top;
    Node *last;
  };
    
  struct Edge
  {
    int source;
    int target;
    T capacity;
    Edge(int source, int target, T capacity) : source(source), target(target), capacity(capacity) {}
  };
  vector<Edge> edges;
  
  void globalRelabeling(
      Node *&nodes, Node *&flow_source, Node *&flow_target, Node *&sentinel, 
      int &active_bucket_length, int &inactive_bucket_length, CsrElement *&csr, Bucket *&active_buckets, Bucket *&inactive_buckets);
};


template <typename T>
void PushRelabel<T>::globalRelabeling(
    Node *&nodes, Node *&flow_source, Node *&flow_target, Node *&sentinel, 
    int &active_bucket_length, int &inactive_bucket_length, CsrElement *&csr, Bucket *&active_buckets, Bucket *&inactive_buckets)
{
  for(Node *node = nodes; node != sentinel; ++node) node->height = vertex_num;
  for(int i = 0; i < vertex_num; ++i){
    active_buckets[i].top = active_buckets[i].last = sentinel;
    inactive_buckets[i].top = inactive_buckets[i].last = sentinel;
  }
  
  active_bucket_length = 0;
  inactive_bucket_length = 0;
  flow_target->height = 0;
  flow_source->height = 0;
  {
    Node *push_inactive_node = flow_target;
    Bucket *push_inactive_bucket = inactive_buckets + push_inactive_node->height;
    Node *push_inactive_current_top = push_inactive_bucket->top;
    push_inactive_node->bucket_prev = sentinel;
    push_inactive_node->bucket_next = push_inactive_current_top;
    push_inactive_current_top->bucket_prev = push_inactive_node;
    push_inactive_bucket->top = push_inactive_node;
    if(inactive_bucket_length < push_inactive_node->height) inactive_bucket_length = push_inactive_node->height;
  }

  
  for(int32_t height = 0; true; ++height){
    int next_height = height + 1;
    if(active_buckets[height].top == sentinel && inactive_buckets[height].top == sentinel) break;
    for(int32_t step = 0; step < 2; ++step){
      for(Node *node = (step == 0 ? active_buckets[height].top : inactive_buckets[height].top); node != sentinel; node = node->bucket_next){
        for(CsrElement *csr_ptr = node->first_csr_element, *end = (node + 1)->first_csr_element; csr_ptr != end; ++csr_ptr){
          if(csr_ptr->target->height != vertex_num) continue;
          if(csr_ptr->reversed_edge->capacity == 0) continue;
          csr_ptr->target->height = next_height;
          if(csr_ptr->target->excess == 0){ 
            Node *push_inactive_node = csr_ptr->target; 
            Bucket *push_inactive_bucket = inactive_buckets + push_inactive_node->height; 
            Node *push_inactive_current_top = push_inactive_bucket->top; 
            push_inactive_node->bucket_prev = sentinel; 
            push_inactive_node->bucket_next = push_inactive_current_top; 
            push_inactive_current_top->bucket_prev = push_inactive_node; 
            push_inactive_bucket->top = push_inactive_node; 
            if(inactive_bucket_length < push_inactive_node->height) inactive_bucket_length = push_inactive_node->height; 
          }else{
            Node *push_active_node = csr_ptr->target; \
            Bucket *push_active_bucket = active_buckets + push_active_node->height; \
            push_active_node->bucket_next = push_active_bucket->top; \
            push_active_bucket->top = push_active_node; \
            if(active_bucket_length < push_active_node->height) active_bucket_length = push_active_node->height; \
          }
        }
      }
    }
  }
  flow_source->height = vertex_num;
}


template <typename T>
T PushRelabel<T>::maxFlow(int flow_source_i, int flow_target_i)
{
  const int edge_num = edges.size();
  Node *nodes;
  Node *flow_source;
  Node *flow_target;
  Node *sentinel;
  Bucket *active_buckets;
  Bucket *inactive_buckets;
  int active_bucket_length;
  int inactive_bucket_length;

  // Construct a CSR.
  {
    // Use height as counter.
    nodes = (Node*)calloc(vertex_num + 1, sizeof(Node));
    for(int vertex = 0; vertex < vertex_num + 1; ++vertex) nodes[vertex].height = 0; 
    for(auto edge: edges){
      ++nodes[edge.source].height;
      ++nodes[edge.target].height;
    }

    csr = (CsrElement*)malloc(edge_num * 2 * sizeof(CsrElement));
    for(int32_t i = 0; i < vertex_num; ++i) nodes[i + 1].height += nodes[i].height;
    for(int32_t i = 0; i <= vertex_num; ++i) nodes[i].first_csr_element = csr + nodes[i].height;
    for(auto edge: edges){
      CsrElement *source_ptr = --nodes[edge.source].first_csr_element;
      CsrElement *target_ptr = --nodes[edge.target].first_csr_element;
      *source_ptr = CsrElement(nodes + edge.target, edge.capacity, target_ptr);
      *target_ptr = CsrElement(nodes + edge.source, 0, source_ptr);
    }
    for(int32_t i = 0; i <= vertex_num; ++i) nodes[i].current_csr_element = nodes[i].first_csr_element;
    
    flow_source = nodes + flow_source_i;
    flow_target = nodes + flow_target_i;
    
    sentinel = nodes + vertex_num;
    active_buckets = (Bucket*)malloc(vertex_num * sizeof(Bucket));
    inactive_buckets = (Bucket*)malloc(vertex_num * sizeof(Bucket));
    for(int i = 0; i < vertex_num; ++i){
      active_buckets[i].top = active_buckets[i].last = sentinel;
      inactive_buckets[i].top = inactive_buckets[i].last = sentinel;
    }
  }
  
  // Push flow from source.
  {
    flow_source->height = vertex_num;
    for(CsrElement *csr_ptr = flow_source->first_csr_element, *end = (flow_source + 1)->first_csr_element; csr_ptr != end; ++csr_ptr){
      csr_ptr->target->excess += csr_ptr->capacity;
    }
    // Dummy up.
    ++flow_target->excess;
  }
  
  // Main.
  {
  
    const int32_t global_relabeling_cycle = vertex_num * 6 + edge_num;
    globalRelabeling(nodes, flow_source, flow_target, sentinel, active_bucket_length, inactive_bucket_length, csr, active_buckets, inactive_buckets);
    
    for(int32_t step = 0; 0 < active_bucket_length;){
      // Global Relabeling.
      if(global_relabeling_cycle < step * 0.5){
        globalRelabeling(nodes, flow_source, flow_target, sentinel, active_bucket_length, inactive_bucket_length, csr, active_buckets, inactive_buckets);
        step = 0;
        continue;
      }
      
      // No active vertex.
      if(active_buckets[active_bucket_length].top == sentinel){
        --active_bucket_length;
        continue;
      }
      
      // Discharge.
      Node *node = active_buckets[active_bucket_length].top; 
      active_buckets[active_bucket_length].top = node->bucket_next;
      assert(node != flow_source);
      assert(node != flow_target);
      CsrElement *csr_ptr = node->current_csr_element;
      T local_excess = node->excess;
      int local_height = node->height;
      for(CsrElement *end = (node + 1)->first_csr_element; true; ++csr_ptr){
      
        // Relabel.
        if(csr_ptr == end){
          int32_t next_height = vertex_num - 1;
          step += 12;
          for(CsrElement *ptr = node->first_csr_element; ptr != end; ++ptr){
            step += 1;
            if(ptr->capacity == 0) continue;
            int32_t h = ptr->target->height;
            if(h < next_height){
              next_height = h;
              csr_ptr = ptr;
            }
          }
          
          
          // Gap relabeling.
          if(local_height != next_height + 1 && active_buckets[local_height].top == sentinel && inactive_buckets[local_height].top == sentinel){
            int max_height = (active_bucket_length < inactive_bucket_length) ? inactive_bucket_length : active_bucket_length;
            for(int height = local_height; height <= max_height; ++height){
              for(Node *node = inactive_buckets[height].top; node != sentinel; node = node->bucket_next){
                node->height = vertex_num;
              }
              inactive_buckets[height].top = sentinel;
            }
            active_bucket_length = local_height;
            inactive_bucket_length = local_height;

            local_height = vertex_num;
            flow_source->excess += local_excess;
            local_excess = 0;
            break;
          }
  
  
          local_height = next_height + 1;
          if(local_height == vertex_num){
            flow_source->excess += local_excess;
            local_excess = 0;
            break;
          }
        }
        
        
        // Push.
        if(0 < csr_ptr->capacity && csr_ptr->target->height < local_height){
          Node *push_target = csr_ptr->target; 
          T flow = (local_excess < csr_ptr->capacity) ? local_excess : csr_ptr->capacity; 
          if(push_target->excess == 0){ 
            Node *remove_prev = push_target->bucket_prev; 
            Node *remove_next = push_target->bucket_next; 
            remove_prev->bucket_next = remove_next;
            remove_next->bucket_prev = remove_prev;
            Bucket *remove_inactive_bucket = inactive_buckets + push_target->height;
            if(remove_inactive_bucket->top == push_target) remove_inactive_bucket->top = remove_next;
            
            Bucket *bucket = active_buckets + push_target->height; 
            push_target->bucket_next = bucket->top; 
            bucket->top = push_target; 
            if(active_bucket_length < push_target->height) active_bucket_length = push_target->height; 

          } 
          local_excess -= flow; 
          csr_ptr->capacity -= flow; 
          push_target->excess += flow; 
          csr_ptr->reversed_edge->capacity += flow; 
      
          if(local_excess == 0){
            node->height = local_height;
            Node *push_inactive_node = node;
            Bucket *push_inactive_bucket = inactive_buckets + push_inactive_node->height;
            Node *push_inactive_current_top = push_inactive_bucket->top;
            push_inactive_node->bucket_prev = sentinel;
            push_inactive_node->bucket_next = push_inactive_current_top;
            push_inactive_current_top->bucket_prev = push_inactive_node;
            push_inactive_bucket->top = push_inactive_node;
            if(inactive_bucket_length < push_inactive_node->height) inactive_bucket_length = push_inactive_node->height;

            break;
          }
        }
      }
      node->height = local_height;
      node->excess = local_excess;
      node->current_csr_element = csr_ptr;
    }
  }
    
  {
    // Dummy down.
    --flow_target->excess;
  }
  
  T answer = flow_target->excess;

  free(csr);
  free(nodes);
  free(active_buckets);
  free(inactive_buckets);

  return answer;
}

template <typename T>
inline void PushRelabel<T>::addEdge(int from, int dest, T capacity)
{
  if(from == dest) return;
  if(capacity == 0) return;
  edges.push_back(Edge(from, dest, capacity));
}





template <typename T> class MaxFlow
{
public:
  void addEdge(int from, int dest, T cap);
  T maxFlow(int flow_source, int flow_target);
  
  MaxFlow(int vertex_num);

private:

  class Edge
  {
  public:
    int target;
    int reversed_index;
    T capacity;
    Edge(int target, int reversed_index, T capacity)
    {
      this->target = target;
      this->reversed_index = reversed_index;
      this->capacity = capacity;
    }
  };

  int vertex_num;
  vector<int> levels;
  vector<int> iters;
  vector<vector<Edge>> edges;
  
  void bfs(int flow_source);
  T dfs(int vertex, int flow_target, T flow);
};

template <typename T>
inline void MaxFlow<T>::bfs(int flow_source)
{
  for(int vertex = 0; vertex < vertex_num; ++vertex) levels[vertex] = -1;
  levels[flow_source] = 0;
  std::queue<int> q;
  q.push(flow_source);
  while(!q.empty()){
    int vertex = q.front();
    q.pop();
    for(Edge &e: edges[vertex]){
      if(levels[e.target] != -1) continue;
      if(e.capacity == 0) continue;
      levels[e.target] = levels[vertex] + 1;
      q.push(e.target);
    }
  }
}

template <typename T>
inline T MaxFlow<T>::dfs(int vertex, int flow_target, T flow)
{
  if(vertex == flow_target) return flow;
  for(int &edge_index = iters[vertex]; edge_index < edges[vertex].size(); ++edge_index){
    Edge &e = edges[vertex][edge_index];
    if(levels[e.target] <= levels[vertex]) continue;
    if(e.capacity == 0) continue;
    T flowed = dfs(e.target, flow_target, flow == -1 ? e.capacity : std::min(flow, e.capacity));
    if(flowed == 0) continue;
    e.capacity -= flowed;
    edges[e.target][e.reversed_index].capacity += flowed;
    return flowed;
  }
  return 0;
}

template <typename T>
inline T MaxFlow<T>::maxFlow(int flow_source, int flow_target)
{
  T total = 0;
  while(true){
    bfs(flow_source);
    if(levels[flow_target] == -1) return total;
    for(int vertex = 0; vertex < vertex_num; ++vertex) iters[vertex] = 0;
    T flow;
    while(0 < (flow = dfs(flow_source, flow_target, -1))) total += flow;
  }
}

template <typename T>
inline MaxFlow<T>::MaxFlow(int vertex_num)
{
  this->vertex_num = vertex_num;
  edges = std::vector<std::vector<Edge>>(vertex_num);
  levels = std::vector<int>(vertex_num);
  iters = std::vector<int>(vertex_num);
}

template <typename T>
inline void MaxFlow<T>::addEdge(int from, int dest, T capacity)
{
  Edge e0(dest, edges[dest].size(), capacity);
  Edge e1(from, edges[from].size(),        0);
  edges[from].push_back(e0);
  edges[dest].push_back(e1);
}


class Timer
{
public:
  void clear();
  double getElapsed();
  
  Timer();
private:
  static double rdtsc_per_sec_inv;
  
  double getTimeOfDay();
  unsigned long long int getCycle();
  
  double start_time;
  unsigned long long int start_clock;
};
double Timer::rdtsc_per_sec_inv = -1;


inline double Timer::getElapsed()
{
	if(rdtsc_per_sec_inv != -1) return (double)(getCycle() - start_clock) * rdtsc_per_sec_inv;

  const double RDTSC_MEASUREMENT_INTERVAL = 0.1;
  double res = getTimeOfDay() - start_time;
  if(res <= RDTSC_MEASUREMENT_INTERVAL) return res;

	rdtsc_per_sec_inv = 1.0 / (getCycle() - start_clock);
	rdtsc_per_sec_inv *= getTimeOfDay() - start_time;
  return getElapsed();
}

inline void Timer::clear()
{
  start_time = getTimeOfDay();
  start_clock = getCycle();
}

Timer::Timer()
{
  clear();
}

inline double Timer::getTimeOfDay()
{
  timeval tv;
  gettimeofday(&tv,0);
  return tv.tv_sec + tv.tv_usec * 0.000001;
}

inline unsigned long long int Timer::getCycle()
{
  unsigned int low, high;
  __asm__ volatile ("rdtsc" : "=a" (low), "=d" (high));
  return ((unsigned long long int)low) | ((unsigned long long int)high << 32);
}


bool run()
{
  Timer timer;
  int n;
  cin >> n;
  vector<string> v(n);
  rep(i, n) cin >> v[i];
  int mini = sz(v[0]);
  vector<int> lengths;
  rep(i, n) lengths.push_back(sz(v[i]));
  sort(all(lengths));
  rep(i, n) mini = min(mini, lengths[i] - (int)i);

  const double LIMIT = 1.9;
  rep(pos, mini){
    if(LIMIT < timer.getElapsed()) return false;
    const int C = 26;
    const int source = n * 2 + 0;
    const int target = n * 2 + 1;
    vector<PushRelabel<int>> flows(C, (n * 2 + 2));
    //vector<MaxFlow<int>> flows(C, (n * 2 + 2));
    rep(i, n)rep(j, n)if(pos + j < sz(v[i])){
      flows[v[i][pos + j] - 'a'].addEdge(i, j + n, 1);
    }
    rep(c, C)rep(i, n) flows[c].addEdge(source, i, 1);
    rep(c, C)rep(i, n) flows[c].addEdge(i + n, target, 1);
    rep(c, C){
      if(LIMIT < timer.getElapsed()) return false;
      if(flows[c].maxFlow(source, target) == n){
        return true;
      }
    }
  }
  return false;

}

int main()
{
  cout << (run() ? "YES" : "NO") << endl;
}









Submission Info

Submission Time
Task B - コメント
User Komaki
Language C++11 (GCC 4.8.1)
Score 90
Code Size 20481 Byte
Status AC
Exec Time 1923 ms
Memory 1772 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 30 / 30 60 / 60
Status
AC × 2
AC × 18
AC × 44
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
Subtask1 sample_01.txt, sample_02.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt
Subtask2 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt, subtask2_16.txt, subtask2_17.txt, subtask2_18.txt, subtask2_19.txt, subtask2_20.txt, subtask2_21.txt, subtask2_22.txt, subtask2_23.txt, subtask2_24.txt, subtask2_25.txt, subtask2_26.txt, subtask2_27.txt, subtask2_28.txt
Case Name Status Exec Time Memory
sample_01.txt AC 24 ms 924 KB
sample_02.txt AC 23 ms 928 KB
subtask1_01.txt AC 22 ms 788 KB
subtask1_02.txt AC 22 ms 804 KB
subtask1_03.txt AC 24 ms 924 KB
subtask1_04.txt AC 23 ms 800 KB
subtask1_05.txt AC 23 ms 940 KB
subtask1_06.txt AC 25 ms 860 KB
subtask1_07.txt AC 25 ms 864 KB
subtask1_08.txt AC 23 ms 928 KB
subtask1_09.txt AC 22 ms 800 KB
subtask1_10.txt AC 29 ms 932 KB
subtask1_11.txt AC 26 ms 800 KB
subtask1_12.txt AC 27 ms 864 KB
subtask1_13.txt AC 23 ms 792 KB
subtask1_14.txt AC 38 ms 928 KB
subtask1_15.txt AC 35 ms 924 KB
subtask1_16.txt AC 22 ms 924 KB
subtask2_01.txt AC 150 ms 1352 KB
subtask2_02.txt AC 1923 ms 1292 KB
subtask2_03.txt AC 30 ms 1516 KB
subtask2_04.txt AC 1190 ms 1240 KB
subtask2_05.txt AC 30 ms 1312 KB
subtask2_06.txt AC 28 ms 932 KB
subtask2_07.txt AC 27 ms 932 KB
subtask2_08.txt AC 30 ms 1180 KB
subtask2_09.txt AC 1923 ms 1324 KB
subtask2_10.txt AC 626 ms 1240 KB
subtask2_11.txt AC 37 ms 1228 KB
subtask2_12.txt AC 1789 ms 1316 KB
subtask2_13.txt AC 1299 ms 1328 KB
subtask2_14.txt AC 1923 ms 1312 KB
subtask2_15.txt AC 945 ms 1300 KB
subtask2_16.txt AC 1290 ms 936 KB
subtask2_17.txt AC 808 ms 924 KB
subtask2_18.txt AC 1129 ms 936 KB
subtask2_19.txt AC 1152 ms 1184 KB
subtask2_20.txt AC 1481 ms 1300 KB
subtask2_21.txt AC 1360 ms 1272 KB
subtask2_22.txt AC 1495 ms 1324 KB
subtask2_23.txt AC 1444 ms 1324 KB
subtask2_24.txt AC 1771 ms 1708 KB
subtask2_25.txt AC 1498 ms 1332 KB
subtask2_26.txt AC 550 ms 1772 KB
subtask2_27.txt AC 1781 ms 1744 KB
subtask2_28.txt AC 1796 ms 1744 KB