Submission #444334

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4443342021-07-13 16:18:11parsabahramiThe short shank; Redemption (BOI21_prison)C++17
70 / 100
520 ms6216 KiB
/* I do it for the glory */
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<double, int> pii;
#define SZ(x) (int) x.size()
#define F first
#define S second
#define lc id << 1
#define rc lc | 1
const int N = 7.5e4 + 10, MOD = 1e9 + 7; const double eps = 1e-14;
int R[N], t[N], n, T, D; pii dp[N], seg[N << 2];
void bld(int id = 1, int l = 1, int r = n + 1) {
seg[id] = {MOD, 0};
if (r - l < 2) return;
int md = (l + r) >> 1;
bld(lc, l, md), bld(rc, md, r);
}
void upd(int p, double x, int y, int id = 1, int l = 1, int r = n + 1) {
if (r - l < 2) { seg[id] = min(seg[id], {x, y}); return; }
int md = (l + r) >> 1;
p < md ? upd(p, x, y, lc, l, md) : upd(p, x, y, rc, md, r);
seg[id] = min(seg[lc], seg[rc]);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

prison.cpp: In function 'int main()':
prison.cpp:59:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   59 |     scanf("%d%d%d", &n, &D, &T);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~
prison.cpp:62:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   62 |         scanf("%d", &t[i]);
      |         ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...