QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#262782#7758. PainterYueyWA 5ms4240kbC++201.7kb2023-11-24 00:24:542023-11-24 00:24:55

Judging History

你现在查看的是最新测评结果

  • [2023-11-24 00:24:55]
  • 评测
  • 测评结果:WA
  • 用时:5ms
  • 内存:4240kb
  • [2023-11-24 00:24:54]
  • 提交

answer

# include <bits/stdc++.h>
# define imax(a , b) ((a) > (b) ? (a) : (b))
# define imin(a , b) ((a) < (b) ? (a) : (b))
# define y1 dafdsfasdf
# define rl ro << 1
# define rr ro << 1 | 1
using namespace std;
const int N = 2e3 + 511;
string s[N];
int x1[N] , x2[N] , y1[N] , y2[N];
int r[N];
char fl[N];
map<pair<int ,int > ,char > mp;
void solve()
{
    int n;
    cin>>n;
    for (int i = 1; i <= n; ++i){
        cin>>s[i];
        if (s[i] == "Render"){
            cin>>x1[i] >> y1[i] >> x2[i] >> y2[i];

            for (int j = y1[i]; j <= y2[i]; ++j)
                for (int k = x1[i]; k <= x2[i]; ++k)
                    mp[{k , j}] = '.';
        }

        if (s[i] == "Circle") cin>>x1[i] >> y1[i] >>r[i] >> fl[i];

        if (s[i] == "Rectangle") cin>>x1[i] >> y1[i] >> x2[i] >> y2[i] >> fl[i];
    }

    for (int i = 1; i <= n; ++i){

        if (s[i] == "Circle"){
            for (auto j : mp){
                int x = j.first.first , y = j.first.second;

                if ((x1[i] - x) * (x1[i] - x) + (y1[i] - y) * (y1[i] - y) <= r[i] * r[i]) mp[{x , y}] = fl[i];
            }
        }

        if (s[i] == "Rectangle"){
            for (auto j : mp){
                int x = j.first.first , y = j.first.second;

                if (x1[i] <= x && x <= x2[i] && y1[i] <= y && y <= y2[i]) mp[{x , y}] = fl[i];
            }
        }

        if (s[i] == "Render"){

            for (int j = y2[i]; j >= y1[i]; --j){
                for (int k = x1[i]; k <= x2[i]; ++k)
                    cout<<mp[{k,  j}];
                cout<<"\n";
            }
        }
    }
}
signed main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T = 1;
    //cin>>T;
    while (T--) solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3432kb

input:

7
Circle 0 0 5 *
Circle -2 2 1 @
Circle 2 2 1 @
Rectangle 0 -1 0 0 ^
Rectangle -2 -2 2 -2 _
Render -5 -5 5 5
Render -1 0 1 2

output:

.....*.....
..*******..
.**@***@**.
.*@@@*@@@*.
.**@***@**.
*****^*****
.****^****.
.**_____**.
.*********.
..*******..
.....*.....
@*@
***
*^*

result:

ok 14 lines

Test #2:

score: 0
Accepted
time: 3ms
memory: 4212kb

input:

10
Rectangle -4262 2204 3116 9357 U
Circle 7078 6883 4684 W
Rectangle 390 675 1195 1251 =
Rectangle 78 2138 3288 2570 5
Rectangle -874 797 -99 1440 3
Render 7261 -4311 7304 -4268
Render 2060 9253 2103 9296
Render -1379 -7141 -1336 -7098
Render 982 5708 1025 5751
Render 1080 -9592 1123 -9549

output:

............................................
............................................
............................................
............................................
............................................
............................................
.................................

result:

ok 220 lines

Test #3:

score: 0
Accepted
time: 0ms
memory: 4120kb

input:

10
Rectangle -10000 -10000 10000 10000 @
Rectangle 1197 -1 1198 1 y
Rectangle 3684 -1 3685 0 &
Circle 8957 0 1 Y
Rectangle -5375 0 -5373 2 <
Circle 2683 0 0 7
Rectangle 1262 -1 1263 -1 i
Circle 3238 0 0 K
Circle -3533 0 0 G
Render -1605 0 8394 0

output:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...

result:

ok single line: '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'

Test #4:

score: 0
Accepted
time: 4ms
memory: 4124kb

input:

10
Rectangle -8228 -3399 3061 5167 P
Circle 600 -5480 5406 b
Rectangle -5644 -7645 -2592 2164 &
Circle 5101 -2822 5474 ~
Rectangle -116 -2676 326 5228 X
Rectangle -3772 1494 -3354 3523 !
Rectangle 2084 -729 2467 1390 ;
Circle -786 900 658 3
Rectangle -290 514 436 662 g
Render -7140 -4510 -7140 5489

output:

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...

result:

ok 10000 lines

Test #5:

score: 0
Accepted
time: 2ms
memory: 3852kb

input:

10
Render 4431 -6882 4486 -6880
Circle -5131 -3627 3919 K
Rectangle 3708 -7820 7499 -3207 c
Render 1734 4783 1752 4818
Circle 94 4899 1950 '
Render 8154 6624 8159 6862
Circle 3837 550 356 0
Render 2230 -2196 2232 -1293
Rectangle -935 701 949 1318 ?
Render 5282 -7624 5997 -7624

output:

........................................................
........................................................
........................................................
...................
...................
...................
...................
...................
...................
............

result:

ok 1183 lines

Test #6:

score: 0
Accepted
time: 2ms
memory: 3796kb

input:

10
Render -6920 -3210 -6633 -3205
Circle 5221 3077 390 F
Render -6294 -8386 -6235 -8360
Circle 65 -687 1867 ]
Render 1017 -8804 1689 -8803
Circle 475 1359 2114 )
Rectangle 52 -1984 1779 -614 M
Rectangle 1506 -2131 2992 -871 g
Render -6910 7316 -6904 7371
Render 8670 -8136 8684 -8117

output:

................................................................................................................................................................................................................................................................................................
..............

result:

ok 111 lines

Test #7:

score: 0
Accepted
time: 2ms
memory: 4116kb

input:

10
Rectangle 310990349 810289642 815443779 836759585 ;
Rectangle 793346907 -272571666 797309793 172290221 ]
Rectangle 467935431 -439130559 544524486 229621852 3
Rectangle -224358535 -197178831 393287874 348972387 s
Rectangle -150003927 9534824 -107643143 77085794 j
Render -883072967 590805088 -88307...

output:

............................................
............................................
............................................
............................................
............................................
............................................
.................................

result:

ok 220 lines

Test #8:

score: -100
Wrong Answer
time: 5ms
memory: 4240kb

input:

10
Rectangle -1000000000 -1000000000 1000000000 1000000000 @
Rectangle 666424716 -2 666424717 -1 6
Circle 755891297 0 0 1
Rectangle -361127769 -2 -361127769 -2 I
Circle -136039484 0 2 R
Circle 728693826 0 0 2
Circle 973790054 0 1 :
Rectangle -15797858 0 -15797857 1 n
Circle -524847486 0 1 F
Render 4...

output:

F:F@F:FF@F:F2FF@F:F2FFRF:F2F::F:F2F::F2F:FR:F2F:FR:F2F:F@FF:F:F2FF:F1F:FF:F@F:FF:FRF:FR@F:F2FRRF:F2F:RF:F2F:FF:F@F:FF2F:FRFF2F:F1FF2F:F2F:2F:F2F::F@F:F2:FRF:FRFFRF:FRFF2F:F@FF:F2F:FF:F2F:F2:F@F:F22FRF:F22F:F2F:2F:F2F:FF:F2F:FFRF2F:FFRF:FRF:2F:F@F:2F:F@F::F2FRF::F@F:F2FFRF:F2FFRF:F2FF:F2F2FF:F2F:FR:F...

result:

wrong answer 1st lines differ - expected: '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@', found: 'F:F@F:FF@F:F2FF@F:F2FFRF:F2F::...:F2F:F2:F2F:F22F:F1F22F:F1F:FF:'