# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
954877 | alo_54 | Broken Device (JOI17_broken_device) | C++14 | 33 ms | 3256 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
string desc(long long X)
{
string resp;
while (X)
{
int mod = X % 2;
if (mod == 1)
{
resp += "1";
}else
{
resp += "0";
}
X /= 2;
}
while (resp.size() < 60)
{
resp += "0";
}
reverse(resp.begin(), resp.end());
resp += resp;
return resp;
}
void Anna( int N, long long X, int K, int P[] )
{
string num = desc(X);
for( int i = 0; i < 120; i++ )
{
int bit = num[i] - '0';
Set(i, bit);
}
int wrongPos = P[0];
if (wrongPos < 120)
{
int r = num[wrongPos] - '0';
Set(120, r);
}else
{
Set(120, 1);
}
for (int i = 121; i < N; i++)
{
Set(i, 1);
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
long long comp(string s)
{
reverse(s.begin(), s.end());
long long resp = 0;
long long p2 = 1;
for (int i = 0; i < s.size(); i++)
{
if (s[i] == '1')
{
resp += p2;
}
p2 *= 2;
}
return resp;
}
long long Bruno( int N, int A[] )
{
string resp;
for (int i = 0; i < 60; i++)
{
if (A[i] == A[i + 60])
{
resp += A[i];
}else
{
resp += A[120];
}
}
long long X = comp(resp);
return X;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |