# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1208364 | mychecksedad | Broken Device (JOI17_broken_device) | C++20 | 32 ms | 1544 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 = 1; i < n; i += 2){
if(good[i - 1] && good[i]){
Set(i, 1);
}else{
Set(i, 0);
}
}
for(int i = 0; i < n; i += 2){
if(i + 1 < n && good[i] && good[i + 1]){
Set(i, X % 2);
X /= 2;
}else{
Set(i, 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;
// for(int i = 1; i <= n; ++i){
// cerr << a[i-1] << ' ';
// }
// cerr << '\n';
for(int i = n - (n % 2 ? 2 : 1); i >= 0; i -= 2){
if(a[i]){
ans *= 2;
ans += a[i - 1];
}
}
// cerr << ans << '\n';
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |