답안 #69960

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
69960 2018-08-22T06:34:44 Z Talant Broken Device (JOI17_broken_device) C++17
0 / 100
72 ms 3744 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[] ){
      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 ++) {
                             ~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 60 ms 3056 KB Output isn't correct - L* = 0
2 Incorrect 55 ms 3712 KB Output isn't correct - L* = 0
3 Incorrect 55 ms 3712 KB Output isn't correct - L* = 0
4 Incorrect 48 ms 3712 KB Output isn't correct - L* = 0
5 Incorrect 59 ms 3712 KB Output isn't correct - L* = 0
6 Incorrect 57 ms 3712 KB Output isn't correct - L* = 0
7 Incorrect 46 ms 3712 KB Output isn't correct - L* = 0
8 Incorrect 51 ms 3712 KB Output isn't correct - L* = 0
9 Incorrect 59 ms 3712 KB Output isn't correct - L* = 0
10 Incorrect 55 ms 3712 KB Output isn't correct - L* = 0
11 Incorrect 47 ms 3712 KB Output isn't correct - L* = 0
12 Incorrect 72 ms 3712 KB Output isn't correct - L* = 0
13 Incorrect 47 ms 3712 KB Output isn't correct - L* = 0
14 Incorrect 61 ms 3744 KB Output isn't correct - L* = 0
15 Incorrect 49 ms 3744 KB Output isn't correct - L* = 0
16 Incorrect 56 ms 3744 KB Output isn't correct - L* = 0
17 Incorrect 41 ms 3744 KB Output isn't correct - L* = 0
18 Incorrect 51 ms 3744 KB Output isn't correct - L* = 0
19 Incorrect 60 ms 3744 KB Output isn't correct - L* = 0
20 Incorrect 54 ms 3744 KB Output isn't correct - L* = 0
21 Incorrect 55 ms 3744 KB Output isn't correct - L* = 0
22 Incorrect 63 ms 3744 KB Output isn't correct - L* = 0
23 Incorrect 48 ms 3744 KB Output isn't correct - L* = 0
24 Incorrect 46 ms 3744 KB Output isn't correct - L* = 0
25 Incorrect 56 ms 3744 KB Output isn't correct - L* = 0
26 Incorrect 48 ms 3744 KB Output isn't correct - L* = 0
27 Incorrect 59 ms 3744 KB Output isn't correct - L* = 0
28 Incorrect 53 ms 3744 KB Output isn't correct - L* = 0
29 Incorrect 54 ms 3744 KB Output isn't correct - L* = 0
30 Incorrect 45 ms 3744 KB Output isn't correct - L* = 0
31 Incorrect 57 ms 3744 KB Output isn't correct - L* = 0
32 Incorrect 47 ms 3744 KB Output isn't correct - L* = 0
33 Incorrect 52 ms 3744 KB Output isn't correct - L* = 0
34 Incorrect 50 ms 3744 KB Output isn't correct - L* = 0
35 Incorrect 48 ms 3744 KB Output isn't correct - L* = 0
36 Incorrect 47 ms 3744 KB Output isn't correct - L* = 0
37 Incorrect 56 ms 3744 KB Output isn't correct - L* = 0
38 Incorrect 53 ms 3744 KB Output isn't correct - L* = 0
39 Incorrect 56 ms 3744 KB Output isn't correct - L* = 0
40 Incorrect 49 ms 3744 KB Output isn't correct - L* = 0