| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 294246 | Lawliet | Nuclearia (CEOI15_nuclearia) | C++17 | 321 ms | 62712 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 , 1LL );
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);
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
