#include <bits/stdc++.h>
#include "Annalib.h"
#define endl '\n'
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define fore(i,l,r) for(int i=l;i<r;i++)
#define fo(i,n) fore(i,0,n)
#define forex(i,r,l) for(int i=r;i>=l;i--)
#define ffo(i,n) forex(i,n-1,0)
#define all(x) x.begin(),x.end()
#define ll long long
using namespace std;
using vi = vector<int>;using ii = pair<int,int>;
string desc(long long X)
{
string resp;
while (X)
{
ll mod = X % 2ll;
if (mod == 1)
{
resp += "1";
}else
{
resp += "0";
}
X /= 2;
}
while ((int)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)
{
wrongPos = 59 - wrongPos;
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 < (int)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] +'0';
}else
{
resp += A[120] + '0';
}
}
long long X = comp(resp);
return X;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
792 KB |
Wrong Answer [3] |
2 |
Incorrect |
1 ms |
784 KB |
Wrong Answer [3] |
3 |
Incorrect |
0 ms |
784 KB |
Wrong Answer [3] |
4 |
Incorrect |
1 ms |
796 KB |
Wrong Answer [3] |
5 |
Incorrect |
1 ms |
780 KB |
Wrong Answer [3] |
6 |
Incorrect |
0 ms |
796 KB |
Wrong Answer [3] |
7 |
Incorrect |
1 ms |
784 KB |
Wrong Answer [3] |
8 |
Incorrect |
1 ms |
796 KB |
Wrong Answer [3] |
9 |
Incorrect |
0 ms |
796 KB |
Wrong Answer [3] |
10 |
Incorrect |
0 ms |
796 KB |
Wrong Answer [3] |
11 |
Incorrect |
1 ms |
784 KB |
Wrong Answer [3] |
12 |
Incorrect |
1 ms |
796 KB |
Wrong Answer [3] |
13 |
Incorrect |
0 ms |
784 KB |
Wrong Answer [3] |
14 |
Incorrect |
0 ms |
800 KB |
Wrong Answer [3] |
15 |
Incorrect |
0 ms |
788 KB |
Wrong Answer [3] |
16 |
Incorrect |
0 ms |
784 KB |
Wrong Answer [3] |
17 |
Incorrect |
0 ms |
796 KB |
Wrong Answer [3] |
18 |
Incorrect |
1 ms |
784 KB |
Wrong Answer [3] |
19 |
Incorrect |
0 ms |
792 KB |
Wrong Answer [3] |
20 |
Incorrect |
0 ms |
792 KB |
Wrong Answer [3] |
21 |
Incorrect |
1 ms |
1176 KB |
Wrong Answer [3] |
22 |
Incorrect |
0 ms |
792 KB |
Wrong Answer [3] |
23 |
Incorrect |
0 ms |
796 KB |
Wrong Answer [3] |
24 |
Incorrect |
1 ms |
796 KB |
Wrong Answer [3] |
25 |
Incorrect |
0 ms |
796 KB |
Wrong Answer [3] |
26 |
Incorrect |
1 ms |
792 KB |
Wrong Answer [3] |
27 |
Incorrect |
1 ms |
796 KB |
Wrong Answer [3] |
28 |
Incorrect |
1 ms |
784 KB |
Wrong Answer [3] |
29 |
Incorrect |
0 ms |
784 KB |
Wrong Answer [3] |
30 |
Incorrect |
0 ms |
788 KB |
Wrong Answer [3] |
31 |
Incorrect |
1 ms |
784 KB |
Wrong Answer [3] |
32 |
Incorrect |
0 ms |
784 KB |
Wrong Answer [3] |
33 |
Incorrect |
0 ms |
780 KB |
Wrong Answer [3] |
34 |
Incorrect |
0 ms |
796 KB |
Wrong Answer [3] |
35 |
Incorrect |
1 ms |
780 KB |
Wrong Answer [3] |
36 |
Incorrect |
1 ms |
796 KB |
Wrong Answer [3] |
37 |
Incorrect |
1 ms |
796 KB |
Wrong Answer [3] |
38 |
Incorrect |
1 ms |
800 KB |
Wrong Answer [3] |
39 |
Incorrect |
0 ms |
784 KB |
Wrong Answer [3] |
40 |
Incorrect |
0 ms |
796 KB |
Wrong Answer [3] |