Submission #1004079

# Submission time Handle Problem Language Result Execution time Memory
1004079 2024-06-21T04:49:15 Z De3b0o Team Contest (JOI22_team) C++14
0 / 100
399 ms 692972 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 = 0;
    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 358 ms 690060 KB Output is correct
2 Correct 398 ms 692972 KB Output is correct
3 Incorrect 399 ms 692820 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 358 ms 690060 KB Output is correct
2 Correct 398 ms 692972 KB Output is correct
3 Incorrect 399 ms 692820 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 367 ms 692968 KB Output is correct
2 Correct 375 ms 692816 KB Output is correct
3 Incorrect 370 ms 692856 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 367 ms 692968 KB Output is correct
2 Correct 375 ms 692816 KB Output is correct
3 Incorrect 370 ms 692856 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 367 ms 692968 KB Output is correct
2 Correct 375 ms 692816 KB Output is correct
3 Incorrect 370 ms 692856 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 367 ms 692968 KB Output is correct
2 Correct 375 ms 692816 KB Output is correct
3 Incorrect 370 ms 692856 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 358 ms 690060 KB Output is correct
2 Correct 398 ms 692972 KB Output is correct
3 Incorrect 399 ms 692820 KB Output isn't correct
4 Halted 0 ms 0 KB -