Submission #991576

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9915762024-06-02 13:35:57blackslexTwo Currencies (JOI23_currencies)C++17
0 / 100
10 ms25436 KiB
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int N = 1e5 + 5, K = 22;
int n, m, q, x, c[N], ca[N], idx[N], dp[K][N], dep[N], par[N];
ll y;
vector<pii> v[N];
vector<int> rc;
struct node {
ll val;
int cnt;
node *l, *r;
node() : val(0LL), cnt(0), l(nullptr), r(nullptr) {}
node(ll val, int cnt) : val(val), cnt(0), l(nullptr), r(nullptr) {}
};
typedef node* pnode;
pnode rt[N];
void build (int l, int r, pnode &cur) {
cur = new node();
if (l == r) return;
int mid = (l + r) >> 1;
build(l, mid, cur->l);
build(mid + 1, r, cur->r);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

currencies.cpp: In function 'int main()':
currencies.cpp:89:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   89 |     for (int i = 1; i < n; i++) if (c[i]) rc.emplace_back(c[i]); rc.emplace_back(0);
      |     ^~~
currencies.cpp:89:66: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   89 |     for (int i = 1; i < n; i++) if (c[i]) rc.emplace_back(c[i]); rc.emplace_back(0);
      |                                                                  ^~
currencies.cpp: In function 'void solve()':
currencies.cpp:77:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   77 |     scanf("%d %d %d %lld", &s, &t, &x, &y);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
currencies.cpp: In function 'int main()':
currencies.cpp:86:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   86 |     scanf("%d %d %d", &n, &m, &q);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
currencies.cpp:87:38: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   87 |     for (int i = 1; i < n; i++) scanf("%d %lld", &x, &y), v[x].emplace_back(y, i), v[y].emplace_back(x, i);
      |                                 ~~~~~^~~~~~~~~~~~~~~~~~~
currencies.cpp:88:22: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   88 |     while (m--) scanf("%d %lld", &x, &y), c[x] += y;
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...