QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#109639 | #2164. Landscape Generator | lohitava | WA | 2ms | 3236kb | C++14 | 1.5kb | 2023-05-30 00:35:21 | 2023-05-30 00:35:22 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
signed main( )
{
int n,k,i,j,x1,x2,x;
char c;
cin >> n >> k;
int a[n],b[n];
for (i=0;i<n;i++)
{
a[i] = 0;
b[i] = 0;
}
for (i=1;i<=k;i++)
{
cin >> c >> x1 >> x2;
x1--;
x2--;
if (c=='R')
{
a[x1] += 1;
if (x2+1 < n)
{
a[x2+1] -= 1;
}
}
else if (c=='D')
{
a[x1] -= 1;
if (x2+1 < n)
{
a[x2+1] += 1;
}
}
else if (c=='H')
{
x = (x2-x1)/2 + 1;
a[x1] += (1-x1);
b[x1] += 1;
a[x1+x] -= (1-x1);
b[x1+x] -= 1;
a[x2-x+1] += x2+1;
b[x2-x+1] += -1;
if (x2+1 < n)
{
a[x2+1] -= x2+1;
b[x2+1] -= -1;
}
}
else
{
x = (x2-x1)/2 + 1;
a[x1] -= (1-x1);
b[x1] -= 1;
a[x1+x] += (1-x1);
b[x1+x] += 1;
a[x2-x+1] -= x2+1;
b[x2-x+1] -= -1;
if (x2+1 < n)
{
a[x2+1] += x2+1;
b[x2+1] += -1;
}
}
}
for (i=1;i<n;i++)
{
a[i] += a[i-1];
b[i] += b[i-1];
}
for (i=0;i<n;i++)
{
a[i] += i*b[i];
cout << a[i] << '\n';
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3236kb
input:
71 1487 H 20 68 D 22 52 H 39 55 V 8 58 V 56 61 V 1 30 V 3 11 V 40 49 H 4 24 H 27 68 H 28 36 R 7 30 V 4 42 V 9 24 D 7 15 R 2 31 V 29 51 R 9 11 V 69 69 R 65 70 H 2 56 V 21 22 D 23 35 H 23 47 D 59 60 D 16 50 V 3 26 V 64 70 H 28 31 R 24 25 H 4 70 D 1 42 D 39 39 D 11 33 V 16 68 H 53 71 V 2 71 H 26 47 H 5...
output:
-2 4 13 27 48 55 54 91 101 110 89 60 62 53 2 -11 -36 5 -39 -44 -58 -100 -160 -46 -107 -101 -152 -71 -68 -108 -91 55 30 -116 -1 -21 -49 66 35 37 85 38 89 154 140 166 63 51 89 41 97 -10 73 -1 38 11 28 16 20 28 6 21 10 10 5 -6 -17 -1 6 -5 2
result:
wrong answer 3rd lines differ - expected: '12', found: '13'