Submission #1208370

#TimeUsernameProblemLanguageResultExecution timeMemory
1208370mychecksedadBroken Device (JOI17_broken_device)C++20
51 / 100
44 ms1576 KiB
/* Author : Mychecksdead */ #include<bits/stdc++.h> #include "Annalib.h" using namespace std; #define ll long long int #define MOD (1000000000+7) #define MOD1 (998244353) #define pb push_back #define all(x) x.begin(), x.end() #define en cout << '\n' #define ff first #define ss second #define pii pair<int,int> #define vi vector<int> const int N = 1e6+100, M = 1e5+10, K = 52, MX = 30; void Anna( int n, long long X, int k, int p[] ){ vector<bool> good(n, 1); for(int i = 0; i < k; ++i) good[p[i]] = 0; for(int i = 2; i < n; i += 3){ if(good[i - 2] && good[i - 1] && good[i]){ Set(i, 1); }else{ Set(i, 0); } } for(int i = 0; i < n; i += 3){ // we'll set i, i+1 if(i + 1 == n){ Set(i, 0); continue; } if(good[i] && good[i + 1] && good[i + 2]){ Set(i, X % 2); X /= 2; Set(i + 1, X % 2); X /= 2; }else{ Set(i, 0); Set(i + 1, 0); } } }
#include<bits/stdc++.h> #include "Brunolib.h" using namespace std; #define ll long long int #define MOD (1000000000+7) #define MOD1 (998244353) #define pb push_back #define all(x) x.begin(), x.end() #define en cout << '\n' #define ff first #define ss second #define pii pair<int,int> #define vi vector<int> const int N = 1e6+100, M = 1e5+10, K = 52, MX = 30; long long Bruno( int n, int a[] ){ ll ans = 0; vi v; for(int i = 2; i < n; i += 3){ if(a[i]){ v.pb(a[i - 2]); v.pb(a[i - 1]); } } reverse(all(v)); for(int b: v){ ans *= 2; ans += b; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...