Submission #120415

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1204152019-06-24 12:26:28tinderPort Facility (JOI17_port_facility)C++14
78 / 100
1806 ms824052 KiB
#include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
const int maxn = 2e6 + 6;
const int mod = 1e9 + 7;
int n, s[maxn], t[maxn];
vector<int> g[maxn], w[maxn];
void add_edge(int u, int v, int col) {
w[u].emplace_back(col);
w[v].emplace_back(col);
g[u].emplace_back(v);
g[v].emplace_back(u);
}
struct info {
int x, id;
info () {}
info (int _x, int _id) {
x = _x, id = _id;
}
bool operator < (const info &that) const {
return x < that.x;
}
};
vector<info> ft[maxn];
int ptr[maxn];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

port_facility.cpp: In function 'void insert(int, info, int, int, int)':
port_facility.cpp:34:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int m = l + r >> 1;
          ~~^~~
port_facility.cpp: In function 'void update(int, int, int, int, int, int, int)':
port_facility.cpp:42:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while(ptr[u] < ft[u].size() and ft[u][ptr[u]].x <= k) ptr[u]++;
         ~~~~~~~^~~~~~~~~~~~~~
port_facility.cpp:45:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  } int m = l + r >> 1;
            ~~^~~
port_facility.cpp: In function 'void build(int, int, int)':
port_facility.cpp:54:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int m = l + r >> 1;
          ~~^~~
port_facility.cpp: In function 'void dfs(int)':
port_facility.cpp:64:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0; i < g[u].size(); i++) {
                 ~~^~~~~~~~~~~~~
port_facility.cpp: In function 'int main(int, const char**)':
port_facility.cpp:97:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~
port_facility.cpp:100:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &s[i], &t[i]);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...