Submission #994122

#TimeUsernameProblemLanguageResultExecution timeMemory
994122irmuunAmusement Park (JOI17_amusement_park)C++17
28 / 100
16 ms3524 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...