답안 #120129

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
120129 2019-06-23T13:49:07 Z turbat 꿈 (IOI13_dreaming) C++14
컴파일 오류
0 ms 0 KB
#include "dreaming.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define ll long long
using pii = pair <int, int>;
using vi = vector <int>;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define ook order_of_key
#define fbo find_by_order
#define sq(x) (x) * (x)
#define N 100005
vector <pii> edg[N];
multiset <int> se;
ll dist, dp[N], dp1[N], up[N], up1[N];
int vis[N];
void dfs(int u, ll mx){
	vis[u] = 1;
	up[u] = mx;
	for (pii v : edg[u])
		if (!vis[v.F]){
			dfs(v.F, max(mx, dp[u]) + v.S);
			dp[u] = max(dp[u], dp[v.F] + v.S);
		}
}
void dfs1(int u, ll mx){
	vis[u] = 2;
	up1[u]	 = mx;
	for (int i = edg[u].size() - 1;i >= 0;i--){
		pii v = edg[u][i];
		if (vis[v.F] < 2){
			dfs1(v.F, max(mx, dp1[u]) + v.S);
			dp1[u] = max(dp1[u], dp1[v.F] + v.S);
		}
	}
	dist = min(dist, max({dp[u], dp1[u], up[u], up1[u]}));
}
int travelTime(int n, int m, int L, int A[], int B[], int T[]) {
	for (int i = 0;i < m;i++){
		edg[A[i]].pb(mp(B[i], T[i]));
		edg[B[i]].pb(mp(A[i], T[i]));
	}
	for (int i = 0;i < n;i++)
    	if (!vis[i]){
    		dist = 1e12;
    		dfs(i, 0);
    		dfs1(i, 0);
    		se.insert(dist);
    	}
    dist = 0;
    while (se.size() > 1){
		ll dist1, dist2;    	
    	dist1 = *se.begin();
    	se.erase(se.begin());
    	dist2 = *se.begin();
    	se.erase(se.begin());   	
    	dist = max(dist1 + dist2 + L, dist);
    	se.insert(max(max(dist1, dist2), min(dist1, dist2) + L));
    }
    return dist;
}     #include "dreaming.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define ll long long
using pii = pair <int, int>;
using vi = vector <int>;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define ook order_of_key
#define fbo find_by_order
#define sq(x) (x) * (x)
#define N 100005
vector <pii> edg[N];
vector <int> se;
ll dist, dp[N], dp1[N], up[N], up1[N];
int vis[N];
void dfs(int u, ll mx){
	vis[u] = 1;
	up[u] = mx;
	for (pii v : edg[u])
		if (!vis[v.F]){
			dfs(v.F, max(mx, dp[u]) + v.S);
			dp[u] = max(dp[u], dp[v.F] + v.S);
		}
}
void dfs1(int u, ll mx){
	vis[u] = 2;
	up1[u]	 = mx;
	for (int i = edg[u].size() - 1;i >= 0;i--){
		pii v = edg[u][i];
		if (vis[v.F] < 2){
			dfs1(v.F, max(mx, dp1[u]) + v.S);
			dp1[u] = max(dp1[u], dp1[v.F] + v.S);
		}
	}
	dist = min(dist, max({dp[u], dp1[u], up[u], up1[u]}));
}
int travelTime(int n, int m, int L, int A[], int B[], int T[]) {
	for (int i = 0;i < m;i++){
		edg[A[i]].pb(mp(B[i], T[i]));
		edg[B[i]].pb(mp(A[i], T[i]));
	}
	int k = 0;
	for (int i = 0;i < n;i++)
    	if (!vis[i]){
    		k++;
    		dist = 1e12;
    		dfs(i, 0);
    		dfs1(i, 0);
    		se.pb(dist);
    	}
    sort(se.begin(), se.end());
    if (se.size() == 1) return dist;
	if (se.size() == 2) return se[0] + se[1] + L;
	return max(se.back() + se[k - 2] + L, se[k - 2] + se[k - 3] + 2 * L);
	
} #include "dreaming.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define ll long long
using pii = pair <int, int>;
using vi = vector <int>;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define ook order_of_key
#define fbo find_by_order
#define sq(x) (x) * (x)
#define N 100005
vector <pii> edg[N];
multiset <int> se;
ll dist, dp[N], dp1[N], up[N], up1[N];
int vis[N];
void dfs(int u, ll mx){
	vis[u] = 1;
	up[u] = mx;
	for (pii v : edg[u])
		if (!vis[v.F]){
			dfs(v.F, max(mx, dp[u]) + v.S);
			dp[u] = max(dp[u], dp[v.F] + v.S);
		}
}
void dfs1(int u, ll mx){
	vis[u] = 2;
	up1[u]	 = mx;
	for (int i = edg[u].size() - 1;i >= 0;i--){
		pii v = edg[u][i];
		if (vis[v.F] < 2){
			dfs1(v.F, max(mx, dp1[u]) + v.S);
			dp1[u] = max(dp1[u], dp1[v.F] + v.S);
		}
	}
	dist = min(dist, max({dp[u], dp1[u], up[u], up1[u]}));
}
int travelTime(int n, int m, int L, int A[], int B[], int T[]) {
	for (int i = 0;i < m;i++){
		edg[A[i]].pb(mp(B[i], T[i]));
		edg[B[i]].pb(mp(A[i], T[i]));
	}
	for (int i = 0;i < n;i++)
    	if (!vis[i]){
    		dist = 1e12;
    		dfs(i, 0);
    		dfs1(i, 0);
    		se.insert(dist);
    	}
    dist = 0;
    while (se.size() > 1){
		ll dist1, dist2;    	
    	dist1 = *se.begin();
    	se.erase(se.begin());
    	dist2 = *se.begin();
    	se.erase(se.begin());   	
    	dist = max(dist1 + dist2 + L, dist);
    	se.insert(max(max(dist1, dist2), min(dist1, dist2) + L));
    }
    return dist;
}     #include "dreaming.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define ll long long
using pii = pair <int, int>;
using vi = vector <int>;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define ook order_of_key
#define fbo find_by_order
#define sq(x) (x) * (x)
#define N 100005
vector <pii> edg[N];
vector <int> se;
ll dist, dp[N], dp1[N], up[N], up1[N];
int vis[N];
void dfs(int u, ll mx){
	vis[u] = 1;
	up[u] = mx;
	for (pii v : edg[u])
		if (!vis[v.F]){
			dfs(v.F, max(mx, dp[u]) + v.S);
			dp[u] = max(dp[u], dp[v.F] + v.S);
		}
}
void dfs1(int u, ll mx){
	vis[u] = 2;
	up1[u]	 = mx;
	for (int i = edg[u].size() - 1;i >= 0;i--){
		pii v = edg[u][i];
		if (vis[v.F] < 2){
			dfs1(v.F, max(mx, dp1[u]) + v.S);
			dp1[u] = max(dp1[u], dp1[v.F] + v.S);
		}
	}
	dist = min(dist, max({dp[u], dp1[u], up[u], up1[u]}));
}
int travelTime(int n, int m, int L, int A[], int B[], int T[]) {
	for (int i = 0;i < m;i++){
		edg[A[i]].pb(mp(B[i], T[i]));
		edg[B[i]].pb(mp(A[i], T[i]));
	}
	int k = 0;
	for (int i = 0;i < n;i++)
    	if (!vis[i]){
    		k++;
    		dist = 1e12;
    		dfs(i, 0);
    		dfs1(i, 0);
    		se.pb(dist);
    	}
    sort(se.begin(), se.end());
    if (se.size() == 1) return dist;
	if (se.size() == 2) return se[0] + se[1] + L;
	return max(se.back() + se[k - 2] + L, se[k - 2] + se[k - 3] + 2 * L);
	
} 

Compilation message

dreaming.cpp:68:7: error: stray '#' in program
 }     #include "dreaming.h"
       ^
dreaming.cpp:131:3: error: stray '#' in program
 } #include "dreaming.h"
   ^
dreaming.cpp:198:7: error: stray '#' in program
 }     #include "dreaming.h"
       ^
dreaming.cpp:68:8: error: 'include' does not name a type
 }     #include "dreaming.h"
        ^~~~~~~
dreaming.cpp:87:19: error: redefinition of 'std::vector<std::pair<int, int> > edg [100005]'
 vector <pii> edg[N];
                   ^
dreaming.cpp:20:14: note: 'std::vector<std::pair<int, int> > edg [100005]' previously declared here
 vector <pii> edg[N];
              ^~~
dreaming.cpp:88:14: error: conflicting declaration 'std::vector<int> se'
 vector <int> se;
              ^~
dreaming.cpp:21:16: note: previous declaration as 'std::multiset<int> se'
 multiset <int> se;
                ^~
dreaming.cpp:89:4: error: redefinition of 'long long int dist'
 ll dist, dp[N], dp1[N], up[N], up1[N];
    ^~~~
dreaming.cpp:22:4: note: 'long long int dist' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
    ^~~~
dreaming.cpp:89:14: error: redefinition of 'long long int dp [100005]'
 ll dist, dp[N], dp1[N], up[N], up1[N];
              ^
dreaming.cpp:22:10: note: 'long long int dp [100005]' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
          ^~
dreaming.cpp:89:22: error: redefinition of 'long long int dp1 [100005]'
 ll dist, dp[N], dp1[N], up[N], up1[N];
                      ^
dreaming.cpp:22:17: note: 'long long int dp1 [100005]' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
                 ^~~
dreaming.cpp:89:29: error: redefinition of 'long long int up [100005]'
 ll dist, dp[N], dp1[N], up[N], up1[N];
                             ^
dreaming.cpp:22:25: note: 'long long int up [100005]' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
                         ^~
dreaming.cpp:89:37: error: redefinition of 'long long int up1 [100005]'
 ll dist, dp[N], dp1[N], up[N], up1[N];
                                     ^
dreaming.cpp:22:32: note: 'long long int up1 [100005]' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
                                ^~~
dreaming.cpp:90:10: error: redefinition of 'int vis [100005]'
 int vis[N];
          ^
dreaming.cpp:23:5: note: 'int vis [100005]' previously declared here
 int vis[N];
     ^~~
dreaming.cpp: In function 'void dfs(int, long long int)':
dreaming.cpp:91:6: error: redefinition of 'void dfs(int, long long int)'
 void dfs(int u, ll mx){
      ^~~
dreaming.cpp:24:6: note: 'void dfs(int, long long int)' previously defined here
 void dfs(int u, ll mx){
      ^~~
dreaming.cpp: In function 'void dfs1(int, long long int)':
dreaming.cpp:100:6: error: redefinition of 'void dfs1(int, long long int)'
 void dfs1(int u, ll mx){
      ^~~~
dreaming.cpp:33:6: note: 'void dfs1(int, long long int)' previously defined here
 void dfs1(int u, ll mx){
      ^~~~
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:112:5: error: redefinition of 'int travelTime(int, int, int, int*, int*, int*)'
 int travelTime(int n, int m, int L, int A[], int B[], int T[]) {
     ^~~~~~~~~~
dreaming.cpp:45:5: note: 'int travelTime(int, int, int, int*, int*, int*)' previously defined here
 int travelTime(int n, int m, int L, int A[], int B[], int T[]) {
     ^~~~~~~~~~
dreaming.cpp:80:12: error: 'class std::multiset<int>' has no member named 'push_back'
 #define pb push_back
            ^
dreaming.cpp:124:10: note: in expansion of macro 'pb'
       se.pb(dist);
          ^~
dreaming.cpp:128:31: error: no match for 'operator[]' (operand types are 'std::multiset<int>' and 'int')
  if (se.size() == 2) return se[0] + se[1] + L;
                               ^
dreaming.cpp:128:39: error: no match for 'operator[]' (operand types are 'std::multiset<int>' and 'int')
  if (se.size() == 2) return se[0] + se[1] + L;
                                       ^
dreaming.cpp:129:16: error: 'class std::multiset<int>' has no member named 'back'
  return max(se.back() + se[k - 2] + L, se[k - 2] + se[k - 3] + 2 * L);
                ^~~~
dreaming.cpp:129:27: error: no match for 'operator[]' (operand types are 'std::multiset<int>' and 'int')
  return max(se.back() + se[k - 2] + L, se[k - 2] + se[k - 3] + 2 * L);
                           ^
dreaming.cpp:129:42: error: no match for 'operator[]' (operand types are 'std::multiset<int>' and 'int')
  return max(se.back() + se[k - 2] + L, se[k - 2] + se[k - 3] + 2 * L);
                                          ^
dreaming.cpp:129:54: error: no match for 'operator[]' (operand types are 'std::multiset<int>' and 'int')
  return max(se.back() + se[k - 2] + L, se[k - 2] + se[k - 3] + 2 * L);
                                                      ^
dreaming.cpp: At global scope:
dreaming.cpp:131:4: error: 'include' does not name a type
 } #include "dreaming.h"
    ^~~~~~~
dreaming.cpp:150:19: error: redefinition of 'std::vector<std::pair<int, int> > edg [100005]'
 vector <pii> edg[N];
                   ^
dreaming.cpp:20:14: note: 'std::vector<std::pair<int, int> > edg [100005]' previously declared here
 vector <pii> edg[N];
              ^~~
dreaming.cpp:151:16: error: redefinition of 'std::multiset<int> se'
 multiset <int> se;
                ^~
dreaming.cpp:21:16: note: 'std::multiset<int> se' previously declared here
 multiset <int> se;
                ^~
dreaming.cpp:152:4: error: redefinition of 'long long int dist'
 ll dist, dp[N], dp1[N], up[N], up1[N];
    ^~~~
dreaming.cpp:22:4: note: 'long long int dist' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
    ^~~~
dreaming.cpp:152:14: error: redefinition of 'long long int dp [100005]'
 ll dist, dp[N], dp1[N], up[N], up1[N];
              ^
dreaming.cpp:22:10: note: 'long long int dp [100005]' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
          ^~
dreaming.cpp:152:22: error: redefinition of 'long long int dp1 [100005]'
 ll dist, dp[N], dp1[N], up[N], up1[N];
                      ^
dreaming.cpp:22:17: note: 'long long int dp1 [100005]' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
                 ^~~
dreaming.cpp:152:29: error: redefinition of 'long long int up [100005]'
 ll dist, dp[N], dp1[N], up[N], up1[N];
                             ^
dreaming.cpp:22:25: note: 'long long int up [100005]' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
                         ^~
dreaming.cpp:152:37: error: redefinition of 'long long int up1 [100005]'
 ll dist, dp[N], dp1[N], up[N], up1[N];
                                     ^
dreaming.cpp:22:32: note: 'long long int up1 [100005]' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
                                ^~~
dreaming.cpp:153:10: error: redefinition of 'int vis [100005]'
 int vis[N];
          ^
dreaming.cpp:23:5: note: 'int vis [100005]' previously declared here
 int vis[N];
     ^~~
dreaming.cpp: In function 'void dfs(int, long long int)':
dreaming.cpp:154:6: error: redefinition of 'void dfs(int, long long int)'
 void dfs(int u, ll mx){
      ^~~
dreaming.cpp:24:6: note: 'void dfs(int, long long int)' previously defined here
 void dfs(int u, ll mx){
      ^~~
dreaming.cpp: In function 'void dfs1(int, long long int)':
dreaming.cpp:163:6: error: redefinition of 'void dfs1(int, long long int)'
 void dfs1(int u, ll mx){
      ^~~~
dreaming.cpp:33:6: note: 'void dfs1(int, long long int)' previously defined here
 void dfs1(int u, ll mx){
      ^~~~
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:175:5: error: redefinition of 'int travelTime(int, int, int, int*, int*, int*)'
 int travelTime(int n, int m, int L, int A[], int B[], int T[]) {
     ^~~~~~~~~~
dreaming.cpp:45:5: note: 'int travelTime(int, int, int, int*, int*, int*)' previously defined here
 int travelTime(int n, int m, int L, int A[], int B[], int T[]) {
     ^~~~~~~~~~
dreaming.cpp: At global scope:
dreaming.cpp:198:8: error: 'include' does not name a type
 }     #include "dreaming.h"
        ^~~~~~~
dreaming.cpp:217:19: error: redefinition of 'std::vector<std::pair<int, int> > edg [100005]'
 vector <pii> edg[N];
                   ^
dreaming.cpp:20:14: note: 'std::vector<std::pair<int, int> > edg [100005]' previously declared here
 vector <pii> edg[N];
              ^~~
dreaming.cpp:218:14: error: conflicting declaration 'std::vector<int> se'
 vector <int> se;
              ^~
dreaming.cpp:21:16: note: previous declaration as 'std::multiset<int> se'
 multiset <int> se;
                ^~
dreaming.cpp:219:4: error: redefinition of 'long long int dist'
 ll dist, dp[N], dp1[N], up[N], up1[N];
    ^~~~
dreaming.cpp:22:4: note: 'long long int dist' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
    ^~~~
dreaming.cpp:219:14: error: redefinition of 'long long int dp [100005]'
 ll dist, dp[N], dp1[N], up[N], up1[N];
              ^
dreaming.cpp:22:10: note: 'long long int dp [100005]' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
          ^~
dreaming.cpp:219:22: error: redefinition of 'long long int dp1 [100005]'
 ll dist, dp[N], dp1[N], up[N], up1[N];
                      ^
dreaming.cpp:22:17: note: 'long long int dp1 [100005]' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
                 ^~~
dreaming.cpp:219:29: error: redefinition of 'long long int up [100005]'
 ll dist, dp[N], dp1[N], up[N], up1[N];
                             ^
dreaming.cpp:22:25: note: 'long long int up [100005]' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
                         ^~
dreaming.cpp:219:37: error: redefinition of 'long long int up1 [100005]'
 ll dist, dp[N], dp1[N], up[N], up1[N];
                                     ^
dreaming.cpp:22:32: note: 'long long int up1 [100005]' previously declared here
 ll dist, dp[N], dp1[N], up[N], up1[N];
                                ^~~
dreaming.cpp:220:10: error: redefinition of 'int vis [100005]'
 int vis[N];
          ^
dreaming.cpp:23:5: note: 'int vis [100005]' previously declared here
 int vis[N];
     ^~~
dreaming.cpp: In function 'void dfs(int, long long int)':
dreaming.cpp:221:6: error: redefinition of 'void dfs(int, long long int)'
 void dfs(int u, ll mx){
      ^~~
dreaming.cpp:24:6: note: 'void dfs(int, long long int)' previously defined here
 void dfs(int u, ll mx){
      ^~~
dreaming.cpp: In function 'void dfs1(int, long long int)':
dreaming.cpp:230:6: error: redefinition of 'void dfs1(int, long long int)'
 void dfs1(int u, ll mx){
      ^~~~
dreaming.cpp:33:6: note: 'void dfs1(int, long long int)' previously defined here
 void dfs1(int u, ll mx){
      ^~~~
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:242:5: error: redefinition of 'int travelTime(int, int, int, int*, int*, int*)'
 int travelTime(int n, int m, int L, int A[], int B[], int T[]) {
     ^~~~~~~~~~
dreaming.cpp:45:5: note: 'int travelTime(int, int, int, int*, int*, int*)' previously defined here
 int travelTime(int n, int m, int L, int A[], int B[], int T[]) {
     ^~~~~~~~~~
dreaming.cpp:210:12: error: 'class std::multiset<int>' has no member named 'push_back'
 #define pb push_back
            ^
dreaming.cpp:254:10: note: in expansion of macro 'pb'
       se.pb(dist);
          ^~
dreaming.cpp:258:31: error: no match for 'operator[]' (operand types are 'std::multiset<int>' and 'int')
  if (se.size() == 2) return se[0] + se[1] + L;
                               ^
dreaming.cpp:258:39: error: no match for 'operator[]' (operand types are 'std::multiset<int>' and 'int')
  if (se.size() == 2) return se[0] + se[1] + L;
                                       ^
dreaming.cpp:259:16: error: 'class std::multiset<int>' has no member named 'back'
  return max(se.back() + se[k - 2] + L, se[k - 2] + se[k - 3] + 2 * L);
                ^~~~
dreaming.cpp:259:27: error: no match for 'operator[]' (operand types are 'std::multiset<int>' and 'int')
  return max(se.back() + se[k - 2] + L, se[k - 2] + se[k - 3] + 2 * L);
                           ^
dreaming.cpp:259:42: error: no match for 'operator[]' (operand types are 'std::multiset<int>' and 'int')
  return max(se.back() + se[k - 2] + L, se[k - 2] + se[k - 3] + 2 * L);
                                          ^
dreaming.cpp:259:54: error: no match for 'operator[]' (operand types are 'std::multiset<int>' and 'int')
  return max(se.back() + se[k - 2] + L, se[k - 2] + se[k - 3] + 2 * L);
                                                      ^
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from dreaming.cpp:2:
/usr/include/c++/7/bits/stl_algo.h: In instantiation of 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::_Rb_tree_const_iterator<int>; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/7/bits/stl_algo.h:4836:18:   required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = std::_Rb_tree_const_iterator<int>]'
dreaming.cpp:126:30:   required from here
/usr/include/c++/7/bits/stl_algo.h:1969:22: error: no match for 'operator-' (operand types are 'std::_Rb_tree_const_iterator<int>' and 'std::_Rb_tree_const_iterator<int>')
     std::__lg(__last - __first) * 2,
               ~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from dreaming.cpp:2:
/usr/include/c++/7/bits/stl_iterator.h:389:5: note: candidate: template<class _IteratorL, class _IteratorR> decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator-(const reverse_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:389:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from dreaming.cpp:2:
/usr/include/c++/7/bits/stl_algo.h:1969:22: note:   'std::_Rb_tree_const_iterator<int>' is not derived from 'const std::reverse_iterator<_Iterator>'
     std::__lg(__last - __first) * 2,
               ~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from dreaming.cpp:2:
/usr/include/c++/7/bits/stl_iterator.h:1191:5: note: candidate: template<class _IteratorL, class _IteratorR> decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
     operator-(const move_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:1191:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from dreaming.cpp:2:
/usr/include/c++/7/bits/stl_algo.h:1969:22: note:   'std::_Rb_tree_const_iterator<int>' is not derived from 'const std::move_iterator<_IteratorL>'
     std::__lg(__last - __first) * 2,
               ~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/7/ccomplex:39:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from dreaming.cpp:2:
/usr/include/c++/7/complex:356:5: note: candidate: template<class _Tp> std::complex<_Tp> std::operator-(const std::complex<_Tp>&, const std::complex<_Tp>&)
     operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
     ^~~~~~~~
/usr/include/c++/7/complex:356:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from dreaming.cpp:2:
/usr/include/c++/7/bits/stl_algo.h:1969:22: note:   'std::_Rb_tree_const_iterator<int>' is not derived from 'const std::complex<_Tp>'
     std::__lg(__last - __first) * 2,
               ~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/7/ccomplex:39:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from dreaming.cpp:2:
/