# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
294244 | 2020-09-08T17:58:56 Z | Lawliet | Nuclearia (CEOI15_nuclearia) | C++17 | 322 ms | 62200 KB |
#include <bits/stdc++.h> using namespace std; typedef long long int lli; int n, m, k, q; vector<lli> s; vector<lli> indep, fact; int main() { scanf("%d %d %d",&n,&m,&k); s.resize( n + 2 , 0 ); indep.resize( n + 2 , 0 ); fact.resize( n + 2 , 0 ); for(int i = 1 ; i <= k ; i++) { lli x, a, b; scanf("%lld %*d %lld %lld",&x,&a,&b); lli L = x - a/b; L = max( L , 0LL ); lli R = x + a/b; R = min( R , n*1LL ); lli valLeft = a - b*x; fact[L] += b; fact[x + 1] -= b; indep[L] += valLeft; indep[x + 1] -= valLeft; lli valRight = a + b*x; fact[x + 1] -= b; fact[R + 1] += b; indep[x + 1] += valRight; indep[R + 1] -= valRight; } lli sumFact = 0; lli sumIndep = 0; for(int i = 1 ; i <= n ; i++) { sumFact += fact[i]; sumIndep += indep[i]; s[i] = s[i - 1] + sumIndep; s[i] += sumFact*i; } scanf("%d",&q); while( q-- ) { int xa, xb; scanf("%d %*d %d %*d",&xa,&xb); lli area = xb - xa + 1; lli sum = s[xb] - s[xa - 1]; lli ans = sum/area; if( (sum%area)*2 >= area ) ans++; printf("%lld\n",ans); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 43 ms | 59000 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 43 ms | 59000 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 194 ms | 61860 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 165 ms | 27000 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 124 ms | 3576 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 153 ms | 15480 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 322 ms | 62200 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 306 ms | 62156 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 221 ms | 3576 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 224 ms | 3064 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 211 ms | 3120 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 210 ms | 3448 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |