Submission #69993

# Submission time Handle Problem Language Result Execution time Memory
69993 2018-08-22T08:07:05 Z Talant Broken Device (JOI17_broken_device) C++17
8 / 100
78 ms 13544 KB
#include "Annalib.h"

#include <bits/stdc++.h>

#define sc second
#define fr first
#define pb push_back
#define mk make_pair

using namespace std;

string bin(long long x) {
      string a = "";
      while(x) {
            a = (char)(x % 2 + '0') + a;
            x /= 2;
      }
      return a;
}
void Anna( int N, long long X, int K, int p[] ){
      string s = bin(X);

      if (p[0] > s.size()) {
            for (int i = 0; i <= s.size(); i ++) {
                  if (i == 0) Set(i,1);
                  else {
                        Set(i,(int)(s[(int)s.size() - i] - '0'));
                  }
            }
            for (int i = (int)(s.size()) + 1; i < N; i ++)
                  Set(i,0);
      }
      else {
            int o = (N - (int)s.size() - 1);
            for (int i = o; i < N; i ++) {
                  if (i == o) Set(i,1);
                  else {
                        Set(i,(int)(s[(int)s.size() - i + (o + 1) - 1] - '0'));
                  }
            }
            for (int i = 0; i < o; i ++) Set(i,0);
      }
}
#include "Brunolib.h"

#include <bits/stdc++.h>

#define sc second
#define fr first
#define pb push_back
#define mk make_pair

using namespace std;

long long id;
long long ans;

long long Bruno( int N, int A[] ){
      id = 0;
      ans = 0;

      for (int i = 0; i < N; i ++) {
            if (A[i]) {
                  id = i + 1;
                  break;
            }
      }
      for (int i = id; i < N; i ++) {
            ans += (1ll << (i - id)) * 1ll *  A[i];
      }
      return ans;
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:23:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (p[0] > s.size()) {
           ~~~~~^~~~~~~~~~
Anna.cpp:24:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (int i = 0; i <= s.size(); i ++) {
                             ~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Partially correct 41 ms 3312 KB Output is partially correct - L* = 14
2 Partially correct 51 ms 4024 KB Output is partially correct - L* = 14
3 Partially correct 45 ms 4024 KB Output is partially correct - L* = 14
4 Partially correct 66 ms 4504 KB Output is partially correct - L* = 14
5 Partially correct 49 ms 4520 KB Output is partially correct - L* = 15
6 Partially correct 68 ms 4768 KB Output is partially correct - L* = 14
7 Partially correct 44 ms 5224 KB Output is partially correct - L* = 14
8 Partially correct 48 ms 5368 KB Output is partially correct - L* = 14
9 Partially correct 48 ms 5616 KB Output is partially correct - L* = 14
10 Partially correct 63 ms 5864 KB Output is partially correct - L* = 14
11 Partially correct 53 ms 6336 KB Output is partially correct - L* = 14
12 Partially correct 44 ms 6576 KB Output is partially correct - L* = 14
13 Partially correct 56 ms 6624 KB Output is partially correct - L* = 14
14 Partially correct 67 ms 6904 KB Output is partially correct - L* = 14
15 Partially correct 45 ms 7160 KB Output is partially correct - L* = 14
16 Partially correct 48 ms 7400 KB Output is partially correct - L* = 14
17 Partially correct 50 ms 7648 KB Output is partially correct - L* = 14
18 Partially correct 53 ms 7920 KB Output is partially correct - L* = 14
19 Partially correct 50 ms 8160 KB Output is partially correct - L* = 14
20 Partially correct 57 ms 8912 KB Output is partially correct - L* = 14
21 Partially correct 51 ms 9168 KB Output is partially correct - L* = 14
22 Partially correct 78 ms 9168 KB Output is partially correct - L* = 14
23 Partially correct 59 ms 9168 KB Output is partially correct - L* = 14
24 Partially correct 47 ms 9376 KB Output is partially correct - L* = 14
25 Partially correct 48 ms 9624 KB Output is partially correct - L* = 14
26 Partially correct 56 ms 9872 KB Output is partially correct - L* = 14
27 Partially correct 51 ms 10120 KB Output is partially correct - L* = 14
28 Partially correct 51 ms 10376 KB Output is partially correct - L* = 14
29 Partially correct 49 ms 10608 KB Output is partially correct - L* = 14
30 Partially correct 51 ms 10848 KB Output is partially correct - L* = 14
31 Partially correct 52 ms 11096 KB Output is partially correct - L* = 14
32 Partially correct 45 ms 11336 KB Output is partially correct - L* = 14
33 Partially correct 49 ms 11584 KB Output is partially correct - L* = 14
34 Partially correct 48 ms 12048 KB Output is partially correct - L* = 14
35 Partially correct 51 ms 12064 KB Output is partially correct - L* = 14
36 Partially correct 53 ms 12536 KB Output is partially correct - L* = 14
37 Partially correct 53 ms 12560 KB Output is partially correct - L* = 14
38 Partially correct 52 ms 12808 KB Output is partially correct - L* = 14
39 Partially correct 48 ms 13048 KB Output is partially correct - L* = 14
40 Partially correct 50 ms 13544 KB Output is partially correct - L* = 14