Submission #414916

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4149162021-05-31 10:37:00Pro_ktmr도로 건설 사업 (JOI13_construction)C++17
100 / 100
4296 ms140560 KiB
#include"bits/stdc++.h"
#include<unordered_set>
#include<unordered_map>
#include<random>
using namespace std;
typedef long long ll;
const ll MOD = (ll)(1e9+7);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
int dx[4]={ 1,0,-1,0 };
int dy[4]={ 0,1,0,-1 };
struct UnionFind{
private:
vector<int> par;
vector<int> siz;
public:
void init(int N){
par.resize(N);
siz.resize(N);
for(int i=0; i<N; i++) par[i] = i;
for(int i=0; i<N; i++) siz[i] = 1;
}
void unite(int a, int b){
int rootA = root(a);
int rootB = root(b);
if(rootA == rootB) return;
if(siz[rootA] < siz[rootB]) swap(rootA, rootB);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

construction.cpp: In function 'int main()':
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:150:5: note: in expansion of macro 'rep'
  150 |     rep(i, N){
      |     ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:155:5: note: in expansion of macro 'rep'
  155 |     rep(i, M){
      |     ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:170:5: note: in expansion of macro 'rep'
  170 |     rep(i, N) tmp[lower_bound(all(zX), X[i])-zX.begin()]
      |     ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:172:5: note: in expansion of macro 'rep'
  172 |     rep(i, M){
      |     ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:179:5: note: in expansion of macro 'rep'
  179 |     rep(i, zX.size()){
      |     ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:180:9: note: in expansion of macro 'rep'
  180 |         rep(j, tmpA[i].size()) rmq.add(tmpA[i][j].first, tmpA[i][j].second, 1);
      |         ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:181:9: note: in expansion of macro 'rep'
  181 |         rep(j, tmpB[i].size()) rmq.add(tmpB[i][j].first, tmpB[i][j].second, -1);
      |         ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:183:9: note: in expansion of macro 'rep'
  183 |         rep(j, tmp[i].size()-1){
      |         ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:192:5: note: in expansion of macro 'rep'
  192 |     rep(i, N) tmp[lower_bound(all(zY), Y[i])-zY.begin()]
      |     ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:194:5: note: in expansion of macro 'rep'
  194 |     rep(i, M){
      |     ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:201:5: note: in expansion of macro 'rep'
  201 |     rep(i, zY.size()){
      |     ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:202:9: note: in expansion of macro 'rep'
  202 |         rep(j, tmpA[i].size()) rmq.add(tmpA[i][j].first, tmpA[i][j].second, 1);
      |         ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:203:9: note: in expansion of macro 'rep'
  203 |         rep(j, tmpB[i].size()) rmq.add(tmpB[i][j].first, tmpB[i][j].second, -1);
      |         ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:205:9: note: in expansion of macro 'rep'
  205 |         rep(j, tmp[i].size()-1){
      |         ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:216:5: note: in expansion of macro 'rep'
  216 |     rep(i, N) cost[i+1] = INF;
      |     ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:219:5: note: in expansion of macro 'rep'
  219 |     rep(i, edge.size()){
      |     ^~~
construction.cpp:11:27: warning: unnecessary parentheses in declaration of 'q' [-Wparentheses]
   11 | #define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
      |                           ^
construction.cpp:230:5: note: in expansion of macro 'rep'
  230 |     rep(q, C){
      |     ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...