Submission #994122

# Submission time Handle Problem Language Result Execution time Memory
994122 2024-06-07T06:48:21 Z irmuun Amusement Park (JOI17_amusement_park) C++17
28 / 100
16 ms 3524 KB
#include<bits/stdc++.h>
#include "Joi.h"

using namespace std;

#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()

void Joi(int N, int M, int A[], int B[], long long X, int T){
    if(T==3){
        for(int i=0;i<N;i++){
            int j=i%60;
            if(X&(1ll<<j)){
                MessageBoard(i,1);
            }
            else{
                MessageBoard(i,0);
            }
        }
        return;
    }
    for(int i=0;i<N;i++){
        if(i<60&&(X&(1ll<<i))){
            MessageBoard(i,1);
        }
        else{
            MessageBoard(i,0);
        }
    }
}
#include<bits/stdc++.h>
#include "Ioi.h"

using namespace std;

#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()

const int maxn=1e4+5;

vector<int>adj[maxn],num(maxn,0);
vector<bool>used(maxn,0);

void dfs(int x,int p){
    used[x]=true;
    for(int y:adj[x]){
        if(y!=p&&!used[y]){
            int val=Move(y);
            num[y]=val;
            dfs(y,x);
        }
    }
    if(p>-1){
        Move(p);
    }
}

long long Ioi(int N, int M, int A[], int B[], int P, int V, int T){
    num[P]=V;
    if(T==3){
        int cur=P;
        while(cur%60>0){
            num[cur-1]=Move(cur-1);
            cur--;
        }
        if(cur>0){
            for(int i=cur-1;i>=cur-60;i--){
                num[i]=Move(i);
            }
            cur-=60;
        }
        for(int i=cur+1;i<cur+60;i++){
            num[i]=Move(i);
        }
        long long ans=0;
        for(int i=cur;i<cur+60;i++){
            if(num[i]==1){
                ans+=(1ll<<(i%60));
            }
        }
        return ans;
    }
    for(int i=0;i<M;i++){
        adj[A[i]].pb(B[i]);
        adj[B[i]].pb(A[i]);
    }
    dfs(P,-1);
    long long ans=0;
    for(int i=0;i<60;i++){
        if(num[i]==1) ans+=(1ll<<i);
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1044 KB Output is correct
2 Correct 0 ms 1048 KB Output is correct
3 Correct 0 ms 1060 KB Output is correct
4 Correct 0 ms 1052 KB Output is correct
5 Correct 2 ms 1056 KB Output is correct
6 Correct 0 ms 1056 KB Output is correct
7 Correct 0 ms 1060 KB Output is correct
8 Correct 1 ms 1056 KB Output is correct
9 Correct 2 ms 1044 KB Output is correct
10 Correct 0 ms 1056 KB Output is correct
11 Correct 3 ms 1376 KB Output is correct
12 Correct 1 ms 1044 KB Output is correct
13 Correct 1 ms 1048 KB Output is correct
14 Correct 1 ms 1060 KB Output is correct
15 Correct 1 ms 1052 KB Output is correct
16 Correct 1 ms 1060 KB Output is correct
17 Correct 1 ms 1052 KB Output is correct
18 Correct 1 ms 1064 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 16 ms 3360 KB Output is correct
2 Correct 16 ms 3524 KB Output is correct
3 Correct 15 ms 3364 KB Output is correct
4 Correct 9 ms 2352 KB Output is correct
5 Correct 9 ms 2864 KB Output is correct
6 Correct 10 ms 2624 KB Output is correct
7 Correct 9 ms 2624 KB Output is correct
8 Correct 9 ms 2616 KB Output is correct
9 Correct 10 ms 2616 KB Output is correct
10 Correct 9 ms 2364 KB Output is correct
11 Correct 9 ms 2360 KB Output is correct
12 Correct 10 ms 2444 KB Output is correct
13 Correct 9 ms 2288 KB Output is correct
14 Correct 9 ms 2400 KB Output is correct
15 Correct 9 ms 2356 KB Output is correct
16 Correct 10 ms 2356 KB Output is correct
17 Correct 9 ms 2368 KB Output is correct
18 Correct 9 ms 2356 KB Output is correct
19 Correct 9 ms 2360 KB Output is correct
20 Correct 6 ms 2592 KB Output is correct
21 Correct 7 ms 2624 KB Output is correct
22 Correct 10 ms 2616 KB Output is correct
23 Correct 10 ms 2580 KB Output is correct
24 Correct 9 ms 2604 KB Output is correct
25 Correct 9 ms 2620 KB Output is correct
26 Correct 11 ms 2612 KB Output is correct
27 Correct 11 ms 2616 KB Output is correct
28 Correct 9 ms 2616 KB Output is correct
29 Correct 8 ms 2336 KB Output is correct
30 Correct 9 ms 2344 KB Output is correct
31 Correct 1 ms 1048 KB Output is correct
32 Correct 0 ms 1056 KB Output is correct
33 Correct 0 ms 1048 KB Output is correct
34 Correct 0 ms 1060 KB Output is correct
35 Correct 0 ms 1044 KB Output is correct
36 Correct 0 ms 1056 KB Output is correct
37 Correct 0 ms 1044 KB Output is correct
38 Correct 0 ms 1056 KB Output is correct
39 Correct 1 ms 1048 KB Output is correct
40 Correct 0 ms 1044 KB Output is correct
41 Correct 2 ms 1048 KB Output is correct
42 Correct 0 ms 1056 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1056 KB Output is correct
2 Correct 0 ms 1052 KB Output is correct
3 Correct 0 ms 1060 KB Output is correct
4 Correct 1 ms 1096 KB Output is correct
5 Correct 2 ms 1084 KB Output is correct
6 Correct 2 ms 1088 KB Output is correct
7 Correct 2 ms 1088 KB Output is correct
8 Correct 1 ms 1096 KB Output is correct
9 Correct 5 ms 2112 KB Output is correct
10 Correct 5 ms 2116 KB Output is correct
11 Correct 5 ms 1932 KB Output is correct
12 Correct 0 ms 1120 KB Output is correct
13 Correct 0 ms 1056 KB Output is correct
14 Correct 0 ms 1044 KB Output is correct
15 Correct 0 ms 1044 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 3372 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 3352 KB Output isn't correct
2 Halted 0 ms 0 KB -