EntropyIncreaser

rts[unfinished]

Feb 22nd, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.11 KB | None | 0 0
  1. #include "rts.h"
  2.  
  3. #include <map>
  4.  
  5. const int N = 300010;
  6.  
  7. namespace task_chain {
  8.     bool vis[N];
  9.     void play(int n) {
  10.         int left = 1, right = 1;
  11.         vis[1] = true;
  12.         for (int u = 1; u <= n; ++u) {
  13.             if (vis[u])
  14.                 continue;
  15.             int v = explore(left, u);
  16.             if (vis[v]) {
  17.                 v = right;
  18.                 while (v != u) {
  19.                     v = explore(v, u);
  20.                     vis[v] = true;
  21.                 }
  22.                 right = u;
  23.             } else {
  24.                 vis[v] = true;
  25.                 while (v != u) {
  26.                     v = explore(v, u);
  27.                     vis[v] = true;
  28.                 }
  29.                 left = u;
  30.             }
  31.         }
  32.     }
  33. }
  34.  
  35. namespace task_normal {
  36.     struct edge {
  37.         int v;
  38.         edge* next;
  39.     };
  40.  
  41.     double ALPHA = 0.6;
  42.     int ecnt;
  43.     bool exp[N];
  44.     int ver[N];
  45.     edge* g[N];
  46.     std::map<int, int> subcenter[N];
  47.  
  48.     void add_edge(int u, int v) {
  49.         static edge pool[N * 2];
  50.         static edge* p = pool;
  51.         p->v = v;
  52.         p->next = g[u];
  53.         g[u] = p++;
  54.     }
  55.  
  56.     void play(int n) {
  57.         exp[1] = true;
  58.         ver[1] = 1;
  59.         ecnt = 1;
  60.         for (int u = 2; u <= n; ++u) {
  61.             if (exp[u])
  62.                 continue;
  63.  
  64.         }
  65.     }
  66. }
  67.  
  68. void play(int n, int T, int dataType) {
  69.     if (dataType == 3)
  70.         return task_chain::play(n);
  71.     return task_normal::play(n);
  72. }
Advertisement
Add Comment
Please, Sign In to add comment