Submission #737717

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7377172023-05-07 15:09:46Username4132Two Currencies (JOI23_currencies)C++14
100 / 100
3325 ms202716 KiB
#include<iostream>
#include<vector>
#include<algorithm>
#include<cassert>
using namespace std;
using ll=long long;
using pii=pair<int, int>;
using pli=pair<ll, int>;
#define forn(i, n) for(int i=0; i<(int)n; ++i)
#define dforn(i, n) for(int i=n-1; i>=0; --i)
#define PB push_back
#define F first
#define S second
inline pli add(pli p1, pli p2){
return {p1.F+p2.F, p1.S+p2.S};
}
struct Vertex{
pli sum;
Vertex *l, *r;
Vertex(pli value={0, 0}) : sum(value), l(NULL), r(NULL) {}
Vertex(Vertex* l1, Vertex* r1) : sum(add(l1->sum, r1->sum)), l(l1), r(r1) {}
};
const int MAXN=100010, LOG=19;
int n, m, q, order[MAXN], tin[MAXN], tout[MAXN], assi[MAXN], up[LOG][MAXN], dep[MAXN], tim;
pii ch[MAXN];
vector<pii> g[MAXN];
Vertex* roots[MAXN];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

currencies.cpp: In function 'int main()':
currencies.cpp:79:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   79 |     scanf("%d %d %d", &n, &m, &q);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
currencies.cpp:81:24: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   81 |         int a, b; scanf("%d %d", &a, &b); --a, --b;
      |                   ~~~~~^~~~~~~~~~~~~~~~~
currencies.cpp:84:21: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   84 |     forn(i, m) scanf("%d %d", &ch[i].S, &ch[i].F), --ch[i].S;
      |                ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
currencies.cpp:97:33: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   97 |         int s, t, x; ll y; scanf("%d %d %d %lld", &s, &t, &x, &y); --s, --t;
      |                            ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...