Submission #1043629

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10436292024-08-04 12:25:29javotazLOSTIKS (INOI20_lostiks)C++17
59 / 100
2085 ms132948 KiB
// In the Name of Allah
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,avx,avx2,sse4.2,popcnt,tune=native")
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define pb push_back
#define pp pop_back
#define all(x) x.begin(), x.end()
const int N = 1e6 + 12, M = 20, inf = 1e9 + 7;
vector<pii> g[N];
int n, s, t, par[N], dp[(1 << M) + 4][M], p[N], kd[N], pd[N], e[N], dis[2 * M + 2][2 * M + 2];
char l[N], r[N];
pii f[2 * M + 2][2 * M + 2];
bool mrk[N];
vector<int> v, d;
void ip() {
cin >> n >> s >> t;
for (int i = 1; i < n; i++) {
int u, v, w;
cin >> u >> v >> w;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In function 'void solve()':
Main.cpp:63:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   63 |  for (int i = 0; i < v.size(); i++)
      |                  ~~^~~~~~~~~~
Main.cpp:65:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   65 |  for (int i = 0; i < v.size(); i++)
      |                  ~~^~~~~~~~~~
Main.cpp: In function 'bool check(int, int, int)':
Main.cpp:71:16: warning: array subscript has type 'char' [-Wchar-subscripts]
   71 |  return ((f[l[v]][r[u]].S | x) == x) && ((f[r[u]][l[u]].S | x) == x);
      |             ~~~^
Main.cpp:71:22: warning: array subscript has type 'char' [-Wchar-subscripts]
   71 |  return ((f[l[v]][r[u]].S | x) == x) && ((f[r[u]][l[u]].S | x) == x);
      |                   ~~~^
Main.cpp:71:48: warning: array subscript has type 'char' [-Wchar-subscripts]
   71 |  return ((f[l[v]][r[u]].S | x) == x) && ((f[r[u]][l[u]].S | x) == x);
      |                                             ~~~^
Main.cpp:71:54: warning: array subscript has type 'char' [-Wchar-subscripts]
   71 |  return ((f[l[v]][r[u]].S | x) == x) && ((f[r[u]][l[u]].S | x) == x);
      |                                                   ~~~^
Main.cpp: In function 'int32_t main()':
Main.cpp:86:22: warning: array subscript has type 'char' [-Wchar-subscripts]
   86 |      if ((f[p[s]][r[i]].S | x) == x && (f[r[i]][l[i]].S | x) == x)
      |                   ~~~^
Main.cpp:86:46: warning: array subscript has type 'char' [-Wchar-subscripts]
   86 |      if ((f[p[s]][r[i]].S | x) == x && (f[r[i]][l[i]].S | x) == x)
      |                                           ~~~^
Main.cpp:86:52: warning: array subscript has type 'char' [-Wchar-subscripts]
   86 |      if ((f[p[s]][r[i]].S | x) == x && (f[r[i]][l[i]].S | x) == x)
      |                                                 ~~~^
Main.cpp:87:32: warning: array subscript has type 'char' [-Wchar-subscripts]
   87 |       dp[mask][i] = f[p[s]][r[i]].F + f[r[i]][l[i]].F;
      |                             ~~~^
Main.cpp:87:44: warning: array subscript has type 'char' [-Wchar-subscripts]
   87 |       dp[mask][i] = f[p[s]][r[i]].F + f[r[i]][l[i]].F;
      |                                         ~~~^
Main.cpp:87:50: warning: array subscript has type 'char' [-Wchar-subscripts]
   87 |       dp[mask][i] = f[p[s]][r[i]].F + f[r[i]][l[i]].F;
      |                                               ~~~^
Main.cpp:91:23: warning: array subscript has type 'char' [-Wchar-subscripts]
   91 |      auto &s = dis[r[i]];
      |                    ~~~^
Main.cpp:96:24: warning: array subscript has type 'char' [-Wchar-subscripts]
   96 |        y = ((y < s[l[j = __builtin_ctz(z)]] + dp[x][j])? y : s[l[j]] + dp[x][j]);
      |                      ~~^~~~~~~~~~~~~~~~~~
Main.cpp:96:42: warning: array subscript has type 'char' [-Wchar-subscripts]
   96 |        y = ((y < s[l[j = __builtin_ctz(z)]] + dp[x][j])? y : s[l[j]] + dp[x][j]);
      |                    ~~~~~~~~~~~~~~~~~~~~~~^
Main.cpp:96:53: warning: array subscript has type 'char' [-Wchar-subscripts]
   96 |        y = ((y < s[l[j = __builtin_ctz(z)]] + dp[x][j])? y : s[l[j]] + dp[x][j]);
      |                                                     ^
Main.cpp:96:66: warning: array subscript has type 'char' [-Wchar-subscripts]
   96 |        y = ((y < s[l[j = __builtin_ctz(z)]] + dp[x][j])? y : s[l[j]] + dp[x][j]);
      |                                                                  ^
Main.cpp:96:67: warning: array subscript has type 'char' [-Wchar-subscripts]
   96 |        y = ((y < s[l[j = __builtin_ctz(z)]] + dp[x][j])? y : s[l[j]] + dp[x][j]);
      |                                                                ~~~^
Main.cpp:96:78: warning: array subscript has type 'char' [-Wchar-subscripts]
   96 |        y = ((y < s[l[j = __builtin_ctz(z)]] + dp[x][j])? y : s[l[j]] + dp[x][j]);
      |                                                                              ^
Main.cpp:96:24: warning: operation on 'j' may be undefined [-Wsequence-point]
   96 |        y = ((y < s[l[j = __builtin_ctz(z)]] + dp[x][j])? y : s[l[j]] + dp[x][j]);
      |                      ~~^~~~~~~~~~~~~~~~~~
Main.cpp:98:29: warning: array subscript has type 'char' [-Wchar-subscripts]
   98 |      dp[mask][i] = y + s[l[i]];
      |                          ~~~^
Main.cpp:100:15: warning: array subscript has type 'char' [-Wchar-subscripts]
  100 |     if ((f[l[i]][p[t]].S | mask) == mask)
      |            ~~~^
Main.cpp:101:40: warning: array subscript has type 'char' [-Wchar-subscripts]
  101 |      ans = min(ans, dp[mask][i] + f[l[i]][p[t]].F);
      |                                     ~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...