Submission #980215

# Submission time Handle Problem Language Result Execution time Memory
980215 2024-05-12T01:17:33 Z vjudge1 Closing Time (IOI23_closing) C++17
0 / 100
44 ms 9688 KB
#include <algorithm>
#include <fstream>
#include <vector>
#include <queue>
#include <stack>
#include <iostream>
#include <cmath>
#include <queue>
#include <set>
#include <string>
#include <cstring>
#include <map>
#include <unordered_map>
#include <unordered_set>
#define F first
#define S second
#define PB push_back
using namespace std;
const long long MOD=1e9+7, INF=1e18;
const int INFI=1e9, N_MAX=200000;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<pair<int, ii>> viii;
typedef vector<vii> vvii;
typedef vector<ll> vll;
typedef vector<vll> vvll;

int max_score(int n, int x, int y, ll k, vi u, vi v, vi w)
//int main()
{
    /*
    int n, x, y;
    ll k;
    cin>>n>>x>>y>>k;
    vll u(n), v(n), w(n);
    for(int i=1;i<n;i++)    cin>>u[i-1];
    for(int i=1;i<n;i++)    cin>>v[i-1];
    for(int i=1;i<n;i++)    cin>>w[i-1];
     */
    vll cost1(n+1, INF), cost2(n+1, INF), c(n+1, 0);
    for(int i=0;i<n-1;i++){
        if(min(u[i], v[i])!=max(u[i], v[i])-1)  return 0;
        c[max(u[i], v[i])]=w[i];
    }
    cost1[x]=cost2[y]=0;
    for(int i=x+1;i<n;i++)  cost1[i]=cost1[i-1]+cost1[i-1]+c[i];
    for(int i=x-1;i>=0;i--)  cost1[i]=cost1[i+1]+cost1[i+1]+c[i+1];
    for(int i=y+1;i<n;i++)  cost2[i]=cost2[i-1]+cost2[i-1]+c[i];
    for(int i=y-1;i>=0;i--)  cost2[i]=cost2[i+1]+cost2[i+1]+c[i+1];
    int ans=2;
    for(int i=x;i>=0;i--)
        for(int j=x;j<n;j++)
            for(int kk=y;kk>=0;kk--)
                for(int h=y;h<n;h++){
                    ll aux;
                    if(kk<j)    aux=cost1[i]+cost1[y]+cost2[h];
                    else    aux=cost1[i]+cost1[j]+cost2[kk]+cost2[h];
                    if(aux<=k)
                        ans=max(ans, (x-i)+(j-x)+(y-kk)+(h-y)+2);
                }
    //cout<<ans<<endl;
    return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB 1st lines differ - on the 1st token, expected: '6', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 44 ms 9688 KB 1st lines differ - on the 1st token, expected: '451', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '3', found: '5'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '3', found: '5'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '3', found: '5'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB 1st lines differ - on the 1st token, expected: '6', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB 1st lines differ - on the 1st token, expected: '6', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB 1st lines differ - on the 1st token, expected: '6', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB 1st lines differ - on the 1st token, expected: '6', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB 1st lines differ - on the 1st token, expected: '6', found: '0'
2 Halted 0 ms 0 KB -