Search is not available for this dataset
name stringlengths 2 112 | description stringlengths 29 13k | source int64 1 7 | difficulty int64 0 25 | solution stringlengths 7 983k | language stringclasses 4
values |
|---|---|---|---|---|---|
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
void addmod(int &a, long long b) {
a = (a + b);
if (a >= 1000000007) a -= 1000000007;
}
void mulmod(int &a, long long b) { a = (a * b) % 1000000007; }
template <class T>
bool domin(T &a, const T &b) {
return a > b ? a = b, 1 : 0;
}
template <class T>
bool domax(T &a, ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const long long INF = 1e15;
const double eps = 1e-8;
template <typename T>
inline void read(T &x) {
x = 0;
int f = 1;
char ch = getchar();
while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
if (ch == '-') {
f = -1;
ch = getchar();
}
while (ch ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
struct node {
int d, p, v;
bool operator<(const node& rhs) const { return d < rhs.d; }
} nd1[MAXN], nd2[MAXN];
int n, m, k;
multiset<int> cm[MAXN], bk[MAXN];
int main() {
cin >> n >> m >> k;
int c1 = 0, c2 = 0;
for (int i = 0; i < m; i++... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const long long inf = 1e11 + 100;
long long n, m, k;
long long startt[1000005], endd[1000005];
long long mint[100005];
struct node {
long long d, f, t, c;
} p[100005];
bool cmp(node a, node b) { return a.d < b.d; }
void init() {
for (int i = 0; i <= n; ++i) mint[i] = in... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > fron[1000010], bac[1000010];
long long minf[1000010], minb[1000010];
int mozf[1000010], mozb[1000010];
int minc[100010];
int main() {
int n, m, k;
scanf("%d%d%d", &n, &m, &k);
for (int i = 0; i < m; i++) {
int d, f, t, c;
scanf("%d%d%d%... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const long long md = 1e9 + 7;
long long n, prefix[1000005], suffix[1000005];
struct flight {
int d, f, t, c;
} a[100005];
int vis[100005];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long q, m, k, h, ans = 0, sum = 0, p, x, y;
cin >>... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
long long dp1[1000005], dp2[1000005], cost[1000005];
struct node {
int r, m, c;
bool operator<(const node &st) const { return r < st.r; }
};
vector<node> from, to;
int main() {
int n, m, k;
scanf("%d%d%d", &n, &m, &k);
while (m--) {
int t, f, d, cc;
scanf(... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
int n, m, k;
struct data {
int day, from, to, cost;
} a[MAXN];
bool cmp(const data &a, const data &b) { return a.day < b.day; }
long long min_so_far[MAXN];
long long min_gather[MAXN];
long long min_leave[MAXN];
int main() {
scanf("%d%d%d", &n, ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
long long n, m, k, day, dep[1000010], arr[1000010], cost[1000010], cel, from,
coss;
long long mini[1000010], wylot[1000010], dolot[1000010], sum, inf = 1e7;
vector<pair<long long, int> > tab;
int ptr;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
struct node {
int d, f, t;
long long c;
} a[100005];
int cmp(node a, node b) { return a.d < b.d; }
long long INF = 0x3f3f3f3f3f3f;
long long cost[100005];
int vis[100005];
int cnt1[1000006];
int cnt2[1000006];
long long sum2[1000006];
long long sum1[1000006];
int main()... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
struct _flight {
int day;
int from;
int to;
long long cost;
};
const long long DAY = 1000000;
const long long MAXN = 100000;
vector<long long> day[DAY + 10];
vector<_flight> F;
long long sum_come[DAY + 10] = {0};
long long cost_come[MAXN + 10] = {0};
long long sum_l... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | # ---------------------------iye ha aam zindegi---------------------------------------------
import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
mod = 10 ** 9 + 7
mod1 = 998244353
# ------------------------------warmup----------------------------
impor... | PYTHON3 |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.util.*;
import java.io.*;
import java.math.*;
import java.lang.*;
public class Main {
private static FastReader sc = new FastReader(System.in);
private static OutputWriter out = new OutputWriter(System.out);
public static void main(String[] args) throws Exception {
int n = sc.nextInt()... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
struct node {
int d, f, t, c;
} a[100010];
int n, m, k, c1[100010], c2[100010];
long long ans, ans1[100010], ans2[100010];
int find(int x, int l, int r) {
int ret = -1, mid;
while (l <= r) {
mid = (l + r) >> 1;
if (a[mid].d >= x)
ret = mid, r = mid - 1;
... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
public class P854D
{
static int days = 1000000;
public static void main(String[] args)
{
FastScanner scan = new FastScanner();
int n = scan.nextInt(), m = scan.... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long sz = 1e6 + 150;
struct ticket {
long long tm, from, to, price;
};
bool cmp(ticket a, ticket b) { return a.tm < b.tm; }
vector<long long> arrive(sz + 150, inf), leave(sz + 150, inf);
long long n, m, k;
vector<long long> used(sz +... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
long long INF = 1e12;
long long pref[1000006], suff[1000009];
long long curr[100003];
vector<pair<int, long long> > go[1000003], back[1000003];
int main() {
int n, m, k;
cin >> n >> m >> k;
for (int i = 1; i <= m; i++) {
int day, d, a;
long long c;
cin >> ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.io.*;
import java.util.*;
public class B {
static InputStream is;
public static void main(String[] args) throws IOException {
is = System.in;
int n = ni();
int m = ni();
int k = ni();
f[] fs = new f[m];
for (int i = 0; i < fs.length; i++) {
fs[i] = new f(ni(),ni(),ni(),ni());
}
A... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
long long maxn = -1e9;
long long minn = 1e15;
long long mod = 1e9 + 7;
const int maxx = 1e6 + 5;
const int base = 311;
struct viet {
long long d, from, to, p;
};
viet a[maxx];
bool cmp(viet x, viet y) { return x.d < y.d; }
bool cmp1(viet x, viet y) { return x.d > y.d; }
l... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e6 + 9;
struct mb {
int d, f, t, c;
};
long long dp1[MAXN], dp2[MAXN];
int v[MAXN];
vector<mb> arr, dep;
bool cmp1(mb a, mb b) {
if (a.d < b.d) return true;
return false;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
in... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
int N, M, K, i, dti, day, ind;
pair<pair<int, int>, pair<int, long long> > A[100000];
long long tot, dep[1000001], ari[1000001], har[100001], ans = -1;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> N >> M >> K;
for (i = 0; i < M; i++) ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 2000010;
int c[N];
struct cmp {
bool operator()(const int& a, const int& b) const {
if (c[a] == c[b]) return a < b;
return c[a] < c[b];
}
};
vector<pair<int, int>> in[N], out[N];
set<int, cmp> pq[N];
int bin[N];
int main() {
... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int M = 1e6 + 5;
const long long INF = 1e15;
struct Flight {
int d, f, t, c;
friend bool operator<(const Flight& a, const Flight& b) { return a.d < b.d; }
};
static int n, m, k;
Flight flt[N];
int Min[N];
long long L[M], R[M];
int update(int... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const long long inf = 1e15;
struct st {
long long d, s, e, c;
};
long long chk[1000005], mnS[1000005], mnE[1000005];
st s[1000005];
bool cmpr(st s1, st s2) { return s1.d < s2.d; }
int main() {
long long i, j, k;
long long n, m, sm, cur;
cin >> n >> m >> k;
for (i ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int RAN = 1e6 + 5;
const long long oo = 1ll << 60;
int n, m, x, y, t, k;
bool M[RAN];
long long c, tot, C[RAN], sol = oo, X[RAN], Y[RAN];
struct par {
int x, y;
long long c;
};
vector<par> v[RAN];
int main() {
scanf("%d %d %d", &n, &m, &k);
for (int i = 1; i <... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
const long long int INF = (1LL << 62) - 1;
using namespace std;
int N, M, K;
set<int> inCapital;
set<pair<int, long long int> > S;
struct flight {
int d, f, t;
long long int c;
bool operator<(const flight &x) const { return d < x.d; }
};
flight F[100005];
long long int ans_arr[100005], an... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.util.*;
public class Main {
static long[] deltaToCapital = new long[1000_007];
static long[] deltaFromCapital = new long[1000_007];
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int m = in.nextInt();
int k =... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > go[1000001];
vector<pair<int, int> > gogo[1000001];
vector<int> mb;
int masf[100001];
set<pair<int, int> > mass[100001];
signed main() {
int n, m, k;
cin >> n >> m >> k;
for (int i = 1; i <= m; ++i) {
int d, f, t, c;
scanf("%d %d %d %d"... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
long long n, k, m;
vector<pair<pair<long long, long long>, pair<long long, long long> > > data;
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
cin >> n >> m >> k;
for (long long i = 0; i < m; i++) {
pair<pair<long long, long long>, pair<long ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
struct lot {
int c;
bool kier;
int koszt;
lot(int c = -1, bool kier = 0, int koszt = 0)
: c(c), kier(kier), koszt(koszt) {}
};
long long sum;
const int rozm = 1e6 + 1;
int ile, ile_lot, czas;
vector<vector<lot> > loty;
vector<lot> tab;
vector<long long> dp;
ve... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
int n, m, i, j, l, z, y, k, x;
long long num, sum;
using namespace std;
const long long LLM = 1e18;
const int maxn = 1e6 + 5;
vector<pair<int, int> > fuck2[maxn];
vector<pair<int, int> > fuck1[maxn];
long long c[maxn], a1[maxn], a2[maxn];
long long x1, x2, x3, x4;
int main(... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9, PI = acos(-1.);
const int INF = 0x3f3f3f3f, MOD = 1e9 + 7;
const int N = 1e5 + 5, M = 1e6 + 5;
int n, m, k, d[N], f[N], t[N], c[N], o[N];
int mi, ma;
int vis[N];
int cc[N], cs[N];
long long tvis, sum;
long long first[4 * M];
void update(int p, ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 |
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Bit... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | /*
* Author Ayub Subhaniya
* Institute DA-IICT
*/
import java.io.*;
import java.math.*;
import java.util.*;
public class Codeforces429D
{
InputStream in;
PrintWriter out;
int MAX=(int)1e6+7;
void solve()
{
int n=ni();
int m=ni();
int k=ni();
if (m==0)
{
out.println(-1);
return;
}
... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
struct data {
int day, from, to, cost;
};
bool cmp(data a, data b) { return a.day < b.day; }
data inp[100000 + 7];
long long lft[1000000 + 7], rgt[1000000 + 7];
int city[100000 + 7];
int main() {
int n, m, k;
scanf("%d %d %d", &n, &m, &k);
for (int i = 0; i < m; i++... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.util.*;
import java.io.*;
public class _0853_B_JuryMeeting {
public static class Query implements Comparable<Query>{
int time, id, val;
public Query(int id, int time, int val) {
this.id = id; this.time = time; this.val = val;
}
public int compareTo(Query q) {
return Integer.compare(this.ti... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;
... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const int INF = 0x3f3f3f3f;
const long long llINF = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;
void read(int &ans) {
long long x = 0, w = 1;
char ch = 0;
while (!isdigit(ch)) {
if (ch == '-') w = -1;
ch = getchar();
}
while (isdi... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Comparator;
import java.util.PriorityQueue;
public class Main {
public static void main(S... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, k;
scanf("%d%d%d", &n, &m, &k);
vector<pair<int, pair<int, int>>> arv;
vector<pair<int, pair<int, int>>> dep;
for (int i = 0; i < m; i++) {
int d, s, e, c;
scanf("%d%d%d%d", &d, &s, &e, &c);
if (e == 0) {
arv.emplace_back(d... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, const T &b) {
return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
return a < b ? a = b, 1 : 0;
}
template <typename T>
inline bool smin(T &a, const T &b) {
return a > b ? a = b : a;... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int N = 1000008;
const long long M = 1000000000000ll;
vector<pair<long long, long long> > a[N], b[N];
priority_queue<pair<long long, pair<long long, long long> > > d;
pair<long long, pair<long long, long long> > dp;
long long n, m, w, ans, cl[N], cr[N], c[N];
long lon... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
void Weapons19() {
long long int n, m, k;
cin >> n >> m >> k;
map<long long int, vector<pair<long long int, long long int>>> arr, dep;
for (long long int i = 0; i < m; i++) {
long long int a, b, c, d;
cin >> a >> b >> c >> d;
if (b == 0)
dep[a].pus... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
int n, m, K;
long long M[101000];
long long B[1010000], E[1010000], S, res = 1e18;
struct point {
int t, a, b, c;
bool operator<(const point &p) const { return t < p.t; }
} w[101000];
int main() {
int i;
scanf("%d%d%d", &n, &m, &K);
for (i = 1; i <= m; i++) {
... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int maxd = 2000036;
const int64_t inf = 1000000000000000018;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, m, k;
cin >> n >> m >> k;
vector<vector<pair<pair<int, int>, int64_t> > > edges(maxd);
for (int i = 0; i < m; ++i) {
p... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e11;
struct souvik {
int d, f, t, c;
} q[100003];
long long int ans[1000005], f[1000005], e[1000005];
bool comp(souvik q, souvik w) { return q.d < w.d; }
int main() {
int n, m, i, j, k;
long long int res = 0;
scanf("%d %d %d", &n, &m, &k);... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
struct s {
int d, t, c;
s() {}
s(int di, int ti, int ci) {
d = di;
t = ti;
c = ci;
}
};
struct ans {
int d;
long long c;
ans() {}
ans(int di, long long ci) {
d = di;
c = ci;
}
};
vector<s> v[2];
vector<ans> a[2];
bool comp(s A, s B) { r... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.io.*;
import java.util.*;
import java.math.*;
import java.util.concurrent.*;
public final class round_432_d
{
static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
static FastScanner sc=new FastScanner(br);
static PrintWriter out=new PrintWriter(System.out);
static Random... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
struct Flight {
int cost;
int city;
};
const int D = 1e6;
int main() {
ios_base::sync_with_stdio(0);
int n, m, k;
cin >> n >> m >> k;
vector<vector<Flight>> to(D + 1);
vector<vector<Flight>> from(D + 1);
for (int i = 0; i < m; ++i) {
... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
inline char nc() {
static char buf[100000], *p1 = buf, *p2 = buf;
return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
? EOF
: *p1++;
}
inline int read() {
char ch = nc();
int sum = 0;
while (!(ch >= '0' && ch <= ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.Comparator... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int maxm = 200005;
struct node {
int d, f, t;
long long c;
bool operator<(const node &b) const { return d < b.d; }
} nodes[maxm];
const long long INF = 1e12;
long long L[1000005], R[1000005];
long long mincost[maxm];
int main() {
long long n;
int m, k;
cin... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
const int N = 1e6 + 10;
vector<pair<pair<long long, long long>, long long> > a, b;
long long pre[N], nxt[N];
int prem[N], nxtm[N];
long long mask[N];
int main() {
int n, m, K;
scanf("%d%d%d", &n, &m, &K);
for (int i = 0; i < m; i++) {
int d,... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int N = 100010;
const int D = 2001000;
int M, n, m, k, d, x, y, c;
int totgo, totback, rest, last, i;
int f[N];
long long sum, lef[D], rig[D];
struct re {
int day, loc, cost;
} a[N], b[N];
inline bool cmp(re x, re y) { return x.day < y.day; }
inline bool cmp2(re x, ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f;
const int MAXN = 1e5 + 10;
const int MAXM = 1e6 + 10;
long long b[MAXN];
long long dp1[MAXM], dp2[MAXM];
struct node {
long long d, f, t, c;
} a[MAXN];
bool cmp(node x, node y) { return x.d < y.d; }
int main() {
int n, m, k;
scanf("%d%d%d", &... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
const double EPS = 1e-6;
inline int readint() {
int sum = 0;
char c = getchar();
bool f = 0;
while (c < '0' || c > '9') {
if (c == '-') f = 1;
c = getchar();
}
while... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
struct node {
int t, x, y;
long long c;
} a[1000005];
bool cmp(node &a, node &b) { return a.t < b.t; }
long long dp1[1000005], dp2[1000005], ji[1000005], last[1000005];
int main() {
int n, m, k;
scanf("%d%d%d", &n, &m, &k);
for (int i = 0; i < m; i++)
scanf("%... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long power(long long a, long long b) {
long long ret = 1;
while (b) {
if (b & 1) ret *= a;
a *= a;
if (ret >= MOD) ret %= MOD;
if (a >= MOD) a %= MOD;
b >>= 1;
}
return ret;
}
long long invmod(long long x) { re... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;
public class Main {
static BufferedReader reader;
static StringTokenizer tokenizer;
static PrintWriter ... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long N = 1e6 + 10;
vector<pair<long long, long long> > ans[N];
vector<pair<long long, long long> > ans1[N];
long long mp[100005];
long long check[100005];
long long check1[100005];
long long p1[N], p[N];
int32_t main() {
long long... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > go_add[1000000 + 5];
vector<pair<int, int> > ret_add[1000000 + 5];
int go_cost[1000000 + 5], ret_cost[1000000 + 5];
multiset<int> go_avl[1000000 + 5], ret_avl[1000000 + 5];
int main() {
int i, n, m, k, d, u, v, c, min_d, r;
long long int mn = 0, ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int mx = 2e5 + 10;
int d[mx], f[mx], t[mx], c[mx];
long long l[mx], r[mx];
pair<pair<int, int>, pair<int, int> > a[mx];
map<int, int> M, mm;
int main() {
ios_base::sync_with_stdio(false), cin.tie(), cout.tie();
int n, m, k;
cin >> n >> m >> k;
for (int i = 0; ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10, M = 1e6 + 20;
const long long inf = 1e12 + 10;
vector<pair<int, int> > v[M][2];
int n, m, k;
long long f[M], g[M];
long long curc[N];
long long solve() {
fill(curc + 1, curc + n + 1, inf);
g[M - 1] = inf * n;
for (int i = M - 2; i >= 1; i--) {
... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
int n, m, k;
vector<pair<int, pair<int, int>>> dolaze;
vector<pair<int, pair<int, int>>> odlaze;
bool included[1000005];
priority_queue<pair<int, pair<int, int>>> pq;
int maxday = 0;
long long dp1[1000005];
long long dp2[1000005];
int cena[1000005];
int main() {
ios_base:... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f3f3f3f3f;
struct node {
int d, f, t, c;
} a[100005];
int b[100005];
long long dp[1000005];
long long dp1[1000005];
bool cmp(node x, node y) { return x.d < y.d; }
int main() {
int n, m, k;
while (~scanf("%d%d%d", &n, &m, &k)) {
for (... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, M = 1e6 + 10;
int n, m, k;
long long cost[N], a[M], b[M];
struct node {
int d, f, t, c;
} s[N];
bool cmp(node a, node b) { return a.d < b.d; }
int main() {
while (~scanf("%d%d%d", &n, &m, &k)) {
for (int i = 1; i <= m; i++)
scanf("%d%d%... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const double pi = 3.141592653589793;
long long inf = 1000000000000000LL;
int flag[21111111];
vector<pair<long long, long long> > vec[1111111], vecc[1111111];
long long f[2111111];
long long s[2111111];
long long low[2111111];
int main() {
ios::sync_with_stdio(false);
ci... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
const long long INF = 1e18;
struct node {
long long d, f, t, c;
} a[N];
long long b[N];
long long dp[1000006], dp1[1000005];
bool cmp(node p, node q) { return p.d < q.d; }
int main() {
int n, m, k;
long long x = 1000000, y = -1;
cin >> n >> ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
struct flight {
int d, f, t, c;
flight() {}
flight(int d, int f, int t, int c) : d(d), f(f), t(t), c(c) {}
bool operator<(const flight& a) const { return d > a.d; }
};
int n, m, k;
priority_queue<flight> arr, dep;
priority_queue<pair<int, int> > cheap[100010];
long ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
template <class T>
inline void upd1(T& a, T b) {
a > b ? a = b : 0;
}
template <class T>
inline void upd2(T& a, T b) {
a < b ? a = b : 0;
}
struct ano {
operator long long() {
long long x = 0, y = 0, c = getchar();
while (c < 48) y = c == 45, c = getchar();
... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
struct sg {
sg(long long _a, long long _b, long long _c) {
num = _a;
day = _b;
cost = _c;
}
long long num;
long long day;
long long cost;
};
bool mmm(const sg i, const sg j) {
if (i.day != j.day)
return i.day < j.day;
else
return i.cost < j... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
int n, m, k;
long long pref[1000010], suf[1000010], pref_sz[1000010], suf_sz[1000010],
cost[1000010];
vector<pair<long long, long long> > a[1000010], b[1000010];
int main() {
long long d, x, y, c;
cin >> n >> m >> k;
for (int i = 0; i < m; ++i) {
cin >> d >> x... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.util.*;
import java.io.*;
import java.math.*;
public class D{
static int n,m,k;
static enum ComMode{Time,Cost};
static ComMode mode;
static class edge implements Comparable<edge>{
public int t,u,v; public long c;
public edge(int t, int u, int v, long c){
this.t=t;
this.u=u;
this.v=v;
t... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
vector<pair<int, pair<int, int> > > go, Back;
int cost[1000002], dp[1000005];
long long pref[1000005], suf[1000005];
int main() {
int n, m, k;
cin >> n >> m >> k;
for (int i = 0; i < m; i++) {
int d, f, t, c;
scanf("%d%d%d%d", &d, &f, &t, &c);
if (f) {
... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
int ans, n, m, f1[1000005], vis[1000005], vis1[1000005], num, g1[1000005], k;
long long f[1000005], g[1000005];
struct he {
int d, s, t, c;
} a[1000005];
bool cmp(he a, he b) { return a.d < b.d; }
int main() {
scanf("%d%d%d", &n, &m, &k);
for (int i = 1; i <= m; i++) ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
long long arr_day[1000010], dep_day[1000010];
int main() {
long long n, m, k;
cin >> n >> m >> k;
vector<pair<long long, pair<long long, long long> > > arrs, deps;
for (int i = 0; i < m; i++) {
long long d, f, t, c;
scanf("%lld%lld%lld%lld", &d, &f, &t, &c);... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | // CodeForces Round #853 B train
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class JuryMeeting {
class Flight implements Comparable<Flight> {
int d,f,t,c;
Flight(String []ss) {
d = Integer.parseInt(ss... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int T = 1e6;
int d[100005], x[100005], c[100005], id[100005];
bool cmp(int a, int b) { return d[a] < d[b]; }
long long f[T + 6], r[T + 6], h[100005];
int main() {
int i, j, k;
int n, m, K;
scanf("%d%d%d", &n, &m, &K);
for (i = 1; i <= m; i++) {
scanf("%d%d... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int sz = 1e6 + 9;
int n, m, k;
long long tr[sz], tr_sum, tr_cnt;
long long ret[sz], ret_sum, ret_cnt;
int d, first, t, c;
vector<pair<pair<int, int>, pair<int, int>>> v;
vector<pair<long long, long long>> home;
long long home_ans[sz];
long long ans = 1e18;
int days[sz... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e5 + 9, maxm = (int)1e6 + 9, INF = 0x3f3f3f3f;
const long long INF2 = 0x3f3f3f3f3f3f3f3fLL;
int n, m, dt, w[maxn];
long long f[maxm], g[maxm];
struct Node {
int d, f, t, c;
void read() { scanf("%d%d%d%d", &d, &f, &t, &c); }
bool operator<(Node c... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
set<pair<pair<long long, long long>, long long> > s[2];
long long aux[100005][2], best[1000005][2];
int main() {
long long n, m, k, d, f, t, c;
scanf("%lld %lld %lld", &n, &m, &k);
for (int i = 0; i < m; i++) {
scanf("%lld %lld %lld %lld", &d, &f, &t, &c);
if ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
struct flight {
int d, f, t, c;
};
int main() {
int n, m, k;
scanf("%d %d %d", &n, &m, &k);
vector<flight> flights(m);
for (int i = 0; i < m; i++) {
scanf("%d %d %d %d", &flights[i].d, &flights[i].f, &flights[i].t,
&flights[i].c);
}
sort(flights.... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
struct nod {
int d, f, t, c;
};
long long ans1[1000005], ans2[1000005];
int cmp(nod x, nod y) { return x.d < y.d; }
nod arr[100005];
int n, m, k;
int vis[100005];
long long sum, num;
int main() {
while (cin >> n >> m >> k) {
for (int i = 1; i <= m; i++)
cin >>... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
public class q5 {
static int gcd(int a, int b) {
if(b==0) return a;
else return gcd(b,a%b);
}
public static void main(String[] args) throws IOException {
Reader.init(System.in);
PrintWriter ... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int N = int(2e5) + 5;
const int LN = (int)3e6 + 7;
const int inf = (int)1e9 + 7;
const long long linf = (long long)1e18 + 7;
int n, m, k;
int u[N];
long long mn[N];
int ans[N];
int cnt = 0;
vector<pair<pair<int, int>, int> > here[LN];
long long now = 0;
long long pref... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
template <class T>
T min(T a, T b, T c) {
return min(a, min(b, c));
}
template <class T>
T min(T a, T b, T c, T d) {
return min(a, min(b, min(c, d)));
}
template <class T>
T max(T a, T b, T c) {
return max(a, max(b, c));
}
template <class T>
T max(T a, T b, T c, T d) ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 10;
const int maxn = 1e6 + 10;
struct node {
int d, l, r;
long long c;
} a[maxn];
long long L[maxn], R[maxn], vis[maxn];
bool cmp(node x, node y) { return x.d < y.d; }
int main() {
int n, m, k;
scanf("%d%d%d", &n, &m, &k);
for (int i =... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long inf = 1e15;
struct node {
int t, x, y;
long long z;
node() {}
node(int _t, int _x, int _y, long long _z) : t(_t), x(_x), y(_y), z(_z) {}
bool operator<(const node& p) const { return t < p.t; }
} a[N];
long long A[N], B[N], C[... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.io.*;
import java.util.*;
public class B {
static class Flight {
int day, cost;
public Flight(int day, int cost) {
this.day = day;
this.cost = cost;
}
}
void submit() {
int n = nextInt();
int m = nextInt();
int k = nextInt();
ArrayList<Flight>[] fst = new ArrayList[n];
Array... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int max_days = 1e6;
const long long inf = 1e12;
struct Flight {
int day, from, to;
long long cost;
};
Flight flights[100100];
long long min_cost_to[100100];
long long min_cost_from[100100];
long long prefix_cost[max_days + 1];
long long suffix_cost[max_days + 1];
... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const long long INF = 1e12;
const int SIZE = 1e6 + 10;
long long BIT[2][SIZE];
void ins(long long bit[], int x, long long v) {
for (; x; x -= x & -x) bit[x] += v;
}
long long qq(long long bit[], int x) {
long long res = 0;
for (; x < SIZE; x += x & -x) res += bit[x];
... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
long long fcost[N], forcost[N], rcost[N], revcost[N], fortill[N], reupto[N];
long long finans = 1e18;
set<long long> s, s2;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
const long long infinity = 1e14;
int n, m, k, i;
cin >> n >> m ... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m, k;
cin >> n >> m >> k;
vector<long long> s1(1e6 + 2, 1LL * (1e12) * n),
s2(1e6 + 2, 1LL * (1e12) * n), c1(n + 1, 1e12), c2(n + 1, 1e12);
vector<pair<int, long long>> come,... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
int n, m, k;
vector<pair<int, int> > in[N + 10], out[N + 10];
long long f1[N + 10], f2[N + 10];
int num1[N + 10], num2[N + 10];
int mi[N + 10], MI[N + 10];
int main() {
ios::sync_with_stdio(0), cin.tie(0);
cin >> n >> m >> k;
for (int i = 1; i <= m;... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class ProblemA
{
static int mod = (int) (1e9+7);
static InputReader in;
static PrintWriter out;
static void solve()
{
in = new InputReader(System.in);
out = new PrintWriter(System.out);
... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
struct node {
long long to, c;
bool operator<(const node &a) const { return a.c < c; }
node(long long _to, long long _c) : to(_to), c(_c) {}
node() {}
};
priority_queue<node> q[1000005];
vector<node> ft[1000005];
vector<node> fb[1000005];
set<long long> s;
long long... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& out, vector<T>& arr) {
for (int64_t i = 0; i < (int64_t)arr.size() - 1; ++i) {
out << arr[i] << " ";
}
if (arr.size()) {
out << arr.back() << '\n';
}
return out;
}
template <typename T>
istream& operator>>... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 110000;
const long long INF = 1E12;
multiset<int> s[MAXN];
struct Flight1 {
int d, p, c;
Flight1(int _d, int _p, int _c) : d(_d), p(_p), c(_c) {}
bool operator<(const Flight1& rhs) const { return d < rhs.d; }
};
struct Flight2 {
int d, p;
multiset... | CPP |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 |
import java.io.*;
import java.util.*;
public class Solution {
static MyScanner sc;
private static PrintWriter out;
static long M = 1000000007;
public static void main(String[] s) throws Exception {
// sc = new MyScanner(new BufferedReader(new StringReader("2 6 5\n" +
// "1 1 0... | JAVA |
854_D. Jury Meeting | Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbered from 0 to n. City 0 is Metropolis that is the meeting point for... | 2 | 10 | #include <bits/stdc++.h>
using namespace std;
constexpr long long mod = 1000000007;
const long long INF = mod * mod;
const long double eps = 1e-12;
const long double pi = acos(-1.0);
long long mod_pow(long long a, long long n, long long m = mod) {
a %= m;
long long res = 1;
while (n) {
if (n & 1) res = res * ... | CPP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.