Submission #1004080

# Submission time Handle Problem Language Result Execution time Memory
1004080 2024-06-21T04:49:40 Z De3b0o Team Contest (JOI22_team) C++14
27 / 100
455 ms 695128 KB
#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define in insert
#define pb push_back
#define ppb pop_back()
#define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define cans cout << ans << "\n";
#define yes cout << "Yes" << "\n";
#define no cout << "No" << "\n";
#define pll pair<ll,ll>
#define lin cout << "\n";
#define sqr 340
#define mod 1000000007
#define mid ((l+r)/2)
#define lc (2*x)
#define rc (2*x+1)

using namespace std;

ll n;
ll X[150009];
ll Y[150009];
ll Z[150009];
ll mx[309][309][309][3];

int main()
{
    d3
    cin >> n;
    for(int i = 0 ; n>i ; i++)
    {
        cin >> X[i] >> Y[i] >> Z[i];
        mx[X[i]][Y[i]][Z[i]][0]=1;
        mx[X[i]][Y[i]][Z[i]][1]=1;
        mx[X[i]][Y[i]][Z[i]][2]=1;
    }
    for(int i = 1 ; 309>i ; i++)
    {
        for(int j = 1 ; 309>j ; j++)
        {
            for(int h = 1 ; 309>h ; h++)
            {
                mx[i][j][h][0]|=mx[i][j-1][h][0];
                mx[i][j][h][0]|=mx[i][j][h-1][0];
                mx[i][j][h][1]|=mx[i-1][j][h][1];
                mx[i][j][h][1]|=mx[i][j][h-1][1];
                mx[i][j][h][2]|=mx[i][j-1][h][2];
                mx[i][j][h][2]|=mx[i-1][j][h][2];
            }
        }
    }
    int ans = -1;
    for(int i = 1 ; 309>i ; i++)
    {
        for(int j = 1 ; 309>j ; j++)
        {
            for(int h = 1 ; 309>h ; h++)
            {
                if(mx[i][j-1][h-1][0]&&mx[i-1][j][h-1][1]&&mx[i-1][j-1][h][2])
                    ans=max(ans,i+j+h);
            }
        }
    }
    cans
}
# Verdict Execution time Memory Grader output
1 Correct 432 ms 690052 KB Output is correct
2 Correct 357 ms 690040 KB Output is correct
3 Correct 362 ms 690000 KB Output is correct
4 Correct 395 ms 690000 KB Output is correct
5 Correct 385 ms 689908 KB Output is correct
6 Correct 344 ms 689828 KB Output is correct
7 Correct 382 ms 690020 KB Output is correct
8 Correct 368 ms 690004 KB Output is correct
9 Correct 356 ms 689852 KB Output is correct
10 Correct 351 ms 690004 KB Output is correct
11 Correct 397 ms 689932 KB Output is correct
12 Correct 375 ms 690004 KB Output is correct
13 Correct 417 ms 689972 KB Output is correct
14 Runtime error 9 ms 348 KB Execution killed with signal 11
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 432 ms 690052 KB Output is correct
2 Correct 357 ms 690040 KB Output is correct
3 Correct 362 ms 690000 KB Output is correct
4 Correct 395 ms 690000 KB Output is correct
5 Correct 385 ms 689908 KB Output is correct
6 Correct 344 ms 689828 KB Output is correct
7 Correct 382 ms 690020 KB Output is correct
8 Correct 368 ms 690004 KB Output is correct
9 Correct 356 ms 689852 KB Output is correct
10 Correct 351 ms 690004 KB Output is correct
11 Correct 397 ms 689932 KB Output is correct
12 Correct 375 ms 690004 KB Output is correct
13 Correct 417 ms 689972 KB Output is correct
14 Runtime error 9 ms 348 KB Execution killed with signal 11
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 379 ms 689884 KB Output is correct
2 Correct 380 ms 690000 KB Output is correct
3 Correct 384 ms 690004 KB Output is correct
4 Correct 374 ms 690004 KB Output is correct
5 Correct 360 ms 690000 KB Output is correct
6 Correct 426 ms 690000 KB Output is correct
7 Correct 359 ms 690232 KB Output is correct
8 Correct 359 ms 690028 KB Output is correct
9 Correct 369 ms 689916 KB Output is correct
10 Correct 364 ms 689968 KB Output is correct
11 Correct 412 ms 694428 KB Output is correct
12 Correct 348 ms 692980 KB Output is correct
13 Correct 353 ms 693588 KB Output is correct
14 Correct 364 ms 694356 KB Output is correct
15 Correct 342 ms 694392 KB Output is correct
16 Correct 359 ms 694352 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 379 ms 689884 KB Output is correct
2 Correct 380 ms 690000 KB Output is correct
3 Correct 384 ms 690004 KB Output is correct
4 Correct 374 ms 690004 KB Output is correct
5 Correct 360 ms 690000 KB Output is correct
6 Correct 426 ms 690000 KB Output is correct
7 Correct 359 ms 690232 KB Output is correct
8 Correct 359 ms 690028 KB Output is correct
9 Correct 369 ms 689916 KB Output is correct
10 Correct 364 ms 689968 KB Output is correct
11 Correct 412 ms 694428 KB Output is correct
12 Correct 348 ms 692980 KB Output is correct
13 Correct 353 ms 693588 KB Output is correct
14 Correct 364 ms 694356 KB Output is correct
15 Correct 342 ms 694392 KB Output is correct
16 Correct 359 ms 694352 KB Output is correct
17 Correct 348 ms 690004 KB Output is correct
18 Correct 363 ms 689924 KB Output is correct
19 Correct 395 ms 690000 KB Output is correct
20 Correct 390 ms 690004 KB Output is correct
21 Correct 382 ms 690260 KB Output is correct
22 Correct 375 ms 694608 KB Output is correct
23 Correct 349 ms 694352 KB Output is correct
24 Correct 356 ms 693332 KB Output is correct
25 Correct 393 ms 694608 KB Output is correct
26 Correct 391 ms 694360 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 379 ms 689884 KB Output is correct
2 Correct 380 ms 690000 KB Output is correct
3 Correct 384 ms 690004 KB Output is correct
4 Correct 374 ms 690004 KB Output is correct
5 Correct 360 ms 690000 KB Output is correct
6 Correct 426 ms 690000 KB Output is correct
7 Correct 359 ms 690232 KB Output is correct
8 Correct 359 ms 690028 KB Output is correct
9 Correct 369 ms 689916 KB Output is correct
10 Correct 364 ms 689968 KB Output is correct
11 Correct 412 ms 694428 KB Output is correct
12 Correct 348 ms 692980 KB Output is correct
13 Correct 353 ms 693588 KB Output is correct
14 Correct 364 ms 694356 KB Output is correct
15 Correct 342 ms 694392 KB Output is correct
16 Correct 359 ms 694352 KB Output is correct
17 Correct 348 ms 690004 KB Output is correct
18 Correct 363 ms 689924 KB Output is correct
19 Correct 395 ms 690000 KB Output is correct
20 Correct 390 ms 690004 KB Output is correct
21 Correct 382 ms 690260 KB Output is correct
22 Correct 375 ms 694608 KB Output is correct
23 Correct 349 ms 694352 KB Output is correct
24 Correct 356 ms 693332 KB Output is correct
25 Correct 393 ms 694608 KB Output is correct
26 Correct 391 ms 694360 KB Output is correct
27 Correct 422 ms 690000 KB Output is correct
28 Correct 405 ms 689960 KB Output is correct
29 Correct 395 ms 689852 KB Output is correct
30 Correct 392 ms 689868 KB Output is correct
31 Correct 436 ms 690140 KB Output is correct
32 Correct 422 ms 690000 KB Output is correct
33 Correct 412 ms 689836 KB Output is correct
34 Correct 435 ms 694876 KB Output is correct
35 Correct 436 ms 694804 KB Output is correct
36 Correct 431 ms 694864 KB Output is correct
37 Correct 449 ms 695128 KB Output is correct
38 Correct 455 ms 694952 KB Output is correct
39 Correct 362 ms 693024 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 379 ms 689884 KB Output is correct
2 Correct 380 ms 690000 KB Output is correct
3 Correct 384 ms 690004 KB Output is correct
4 Correct 374 ms 690004 KB Output is correct
5 Correct 360 ms 690000 KB Output is correct
6 Correct 426 ms 690000 KB Output is correct
7 Correct 359 ms 690232 KB Output is correct
8 Correct 359 ms 690028 KB Output is correct
9 Correct 369 ms 689916 KB Output is correct
10 Correct 364 ms 689968 KB Output is correct
11 Correct 412 ms 694428 KB Output is correct
12 Correct 348 ms 692980 KB Output is correct
13 Correct 353 ms 693588 KB Output is correct
14 Correct 364 ms 694356 KB Output is correct
15 Correct 342 ms 694392 KB Output is correct
16 Correct 359 ms 694352 KB Output is correct
17 Correct 348 ms 690004 KB Output is correct
18 Correct 363 ms 689924 KB Output is correct
19 Correct 395 ms 690000 KB Output is correct
20 Correct 390 ms 690004 KB Output is correct
21 Correct 382 ms 690260 KB Output is correct
22 Correct 375 ms 694608 KB Output is correct
23 Correct 349 ms 694352 KB Output is correct
24 Correct 356 ms 693332 KB Output is correct
25 Correct 393 ms 694608 KB Output is correct
26 Correct 391 ms 694360 KB Output is correct
27 Correct 422 ms 690000 KB Output is correct
28 Correct 405 ms 689960 KB Output is correct
29 Correct 395 ms 689852 KB Output is correct
30 Correct 392 ms 689868 KB Output is correct
31 Correct 436 ms 690140 KB Output is correct
32 Correct 422 ms 690000 KB Output is correct
33 Correct 412 ms 689836 KB Output is correct
34 Correct 435 ms 694876 KB Output is correct
35 Correct 436 ms 694804 KB Output is correct
36 Correct 431 ms 694864 KB Output is correct
37 Correct 449 ms 695128 KB Output is correct
38 Correct 455 ms 694952 KB Output is correct
39 Correct 362 ms 693024 KB Output is correct
40 Runtime error 9 ms 344 KB Execution killed with signal 11
41 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 432 ms 690052 KB Output is correct
2 Correct 357 ms 690040 KB Output is correct
3 Correct 362 ms 690000 KB Output is correct
4 Correct 395 ms 690000 KB Output is correct
5 Correct 385 ms 689908 KB Output is correct
6 Correct 344 ms 689828 KB Output is correct
7 Correct 382 ms 690020 KB Output is correct
8 Correct 368 ms 690004 KB Output is correct
9 Correct 356 ms 689852 KB Output is correct
10 Correct 351 ms 690004 KB Output is correct
11 Correct 397 ms 689932 KB Output is correct
12 Correct 375 ms 690004 KB Output is correct
13 Correct 417 ms 689972 KB Output is correct
14 Runtime error 9 ms 348 KB Execution killed with signal 11
15 Halted 0 ms 0 KB -