Submission #954909

# Submission time Handle Problem Language Result Execution time Memory
954909 2024-03-28T19:25:17 Z alo_54 Broken Device (JOI17_broken_device) C++14
0 / 100
34 ms 2652 KB
#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 = 119 - 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;
}
# Verdict Execution time Memory Grader output
1 Partially correct 30 ms 2396 KB Output isn't correct - L* = 0
2 Partially correct 24 ms 2408 KB Output isn't correct - L* = 0
3 Partially correct 24 ms 2396 KB Output isn't correct - L* = 0
4 Partially correct 26 ms 2592 KB Output isn't correct - L* = 0
5 Partially correct 24 ms 2532 KB Output isn't correct - L* = 0
6 Partially correct 27 ms 2396 KB Output isn't correct - L* = 0
7 Partially correct 25 ms 2404 KB Output isn't correct - L* = 0
8 Partially correct 25 ms 2620 KB Output isn't correct - L* = 0
9 Partially correct 24 ms 2396 KB Output isn't correct - L* = 0
10 Partially correct 24 ms 2392 KB Output isn't correct - L* = 0
11 Partially correct 24 ms 2372 KB Output isn't correct - L* = 0
12 Partially correct 24 ms 2476 KB Output isn't correct - L* = 0
13 Partially correct 24 ms 2400 KB Output isn't correct - L* = 0
14 Partially correct 23 ms 2404 KB Output isn't correct - L* = 0
15 Partially correct 24 ms 2404 KB Output isn't correct - L* = 0
16 Partially correct 25 ms 2396 KB Output isn't correct - L* = 0
17 Partially correct 27 ms 2604 KB Output isn't correct - L* = 0
18 Partially correct 23 ms 2392 KB Output isn't correct - L* = 0
19 Partially correct 25 ms 2488 KB Output isn't correct - L* = 0
20 Partially correct 25 ms 2440 KB Output isn't correct - L* = 0
21 Partially correct 24 ms 2408 KB Output isn't correct - L* = 0
22 Partially correct 23 ms 2396 KB Output isn't correct - L* = 0
23 Partially correct 24 ms 2368 KB Output isn't correct - L* = 0
24 Partially correct 27 ms 2396 KB Output isn't correct - L* = 0
25 Partially correct 24 ms 2404 KB Output isn't correct - L* = 0
26 Partially correct 24 ms 2404 KB Output isn't correct - L* = 0
27 Partially correct 24 ms 2400 KB Output isn't correct - L* = 0
28 Partially correct 24 ms 2404 KB Output isn't correct - L* = 0
29 Partially correct 24 ms 2396 KB Output isn't correct - L* = 0
30 Partially correct 24 ms 2396 KB Output isn't correct - L* = 0
31 Partially correct 25 ms 2408 KB Output isn't correct - L* = 0
32 Partially correct 26 ms 2628 KB Output isn't correct - L* = 0
33 Partially correct 23 ms 2652 KB Output isn't correct - L* = 0
34 Partially correct 24 ms 2404 KB Output isn't correct - L* = 0
35 Partially correct 24 ms 2404 KB Output isn't correct - L* = 0
36 Partially correct 24 ms 2396 KB Output isn't correct - L* = 0
37 Partially correct 24 ms 2396 KB Output isn't correct - L* = 0
38 Partially correct 25 ms 2396 KB Output isn't correct - L* = 0
39 Partially correct 34 ms 2396 KB Output isn't correct - L* = 0
40 Partially correct 27 ms 2404 KB Output isn't correct - L* = 0