답안 #1077432

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1077432 2024-08-27T07:09:37 Z thelegendary08 Broken Device (JOI17_broken_device) C++14
0 / 100
32 ms 3024 KB
#include "Annalib.h"
#include<bits/stdc++.h>
#define f0r(i,n) for(int i = 0; i<n;i++)
#define pb push_back
#define vb vector<bool>
#define vi vector<int>
using namespace std;
void Anna( int n, long long x, int k, int p[] ){
	vector<bool>broken(n);
	f0r(i, k){
		broken[p[i]] = 1;
	}
	vb ret(n, 0);
	long long mult = pow(3, 37);
	vi v;
	while(x > 0){
		if(x >= mult * 2)v.pb(2);
		else if(x >= mult)v.pb(1);
		else v.pb(0);
		x -= mult * v[v.size() - 1];
		mult /= 3;
	}
	
	//for(auto u : v)cout<<u<<' ';
	//cout<<'\n';
	
	int ptr = 0;
	f0r(i, 75){
		if(broken[i*2] || broken[i*2+1] || ptr==v.size()){
			ret[i*2] = 0;
			ret[i*2+1] = 0;
		}
		else if(v[ptr] == 0){
			ret[i*2] = 0;
			ret[i*2+1] = 1;
		}
		else if(v[ptr] == 1){
			ret[i*2] = 1;
			ret[i*2+1] = 0;
		}
		else {
			ret[i*2] = 1;
			ret[i*2+1] = 1;
		}
	}
	f0r(i, n){
		Set(i, ret[i]);
	}
	
}
#include "Brunolib.h"
#include<bits/stdc++.h>
#define f0r(i,n) for(int i = 0; i<n;i++)
#define pb push_back
#define vb vector<bool>
#define vi vector<int>
using namespace std;
long long Bruno( int n, int A[] ){
	//for(int i = 0; i<N;i++)cout<<A[i]<<' ';
	//cout<<'\n';
  	long long ret = 0;
  	
  	long long cur = pow(3, 37);
  	f0r(i, 75){
  		if(A[i*2]== 1 && A[i*2+1] == 0){
  			ret += cur;
  		}
  		else if(A[i*2] == 1 && A[i*2+1] == 1){
  			ret += cur * 2;
  		}
  		cur/=3;
  	}
  	//cout<<ret;
  	return ret;
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:29:41: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |   if(broken[i*2] || broken[i*2+1] || ptr==v.size()){
      |                                      ~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Partially correct 25 ms 2776 KB Output isn't correct - L* = 0
2 Partially correct 22 ms 2784 KB Output isn't correct - L* = 0
3 Partially correct 28 ms 2772 KB Output isn't correct - L* = 0
4 Partially correct 28 ms 2912 KB Output isn't correct - L* = 0
5 Partially correct 22 ms 2716 KB Output isn't correct - L* = 0
6 Partially correct 20 ms 2772 KB Output isn't correct - L* = 0
7 Partially correct 20 ms 2776 KB Output isn't correct - L* = 0
8 Partially correct 20 ms 2880 KB Output isn't correct - L* = 0
9 Partially correct 22 ms 2780 KB Output isn't correct - L* = 0
10 Partially correct 23 ms 2776 KB Output isn't correct - L* = 0
11 Partially correct 20 ms 2788 KB Output isn't correct - L* = 0
12 Partially correct 20 ms 2860 KB Output isn't correct - L* = 0
13 Partially correct 22 ms 2768 KB Output isn't correct - L* = 0
14 Partially correct 26 ms 2768 KB Output isn't correct - L* = 0
15 Partially correct 22 ms 2768 KB Output isn't correct - L* = 0
16 Partially correct 23 ms 2772 KB Output isn't correct - L* = 0
17 Partially correct 22 ms 2772 KB Output isn't correct - L* = 0
18 Partially correct 20 ms 2772 KB Output isn't correct - L* = 0
19 Partially correct 20 ms 2776 KB Output isn't correct - L* = 0
20 Partially correct 20 ms 2776 KB Output isn't correct - L* = 0
21 Partially correct 23 ms 2772 KB Output isn't correct - L* = 0
22 Partially correct 32 ms 2772 KB Output isn't correct - L* = 0
23 Partially correct 22 ms 2780 KB Output isn't correct - L* = 0
24 Partially correct 22 ms 2776 KB Output isn't correct - L* = 0
25 Partially correct 22 ms 2756 KB Output isn't correct - L* = 0
26 Partially correct 20 ms 2772 KB Output isn't correct - L* = 0
27 Partially correct 23 ms 2768 KB Output isn't correct - L* = 0
28 Partially correct 28 ms 2768 KB Output isn't correct - L* = 0
29 Partially correct 22 ms 2768 KB Output isn't correct - L* = 0
30 Partially correct 20 ms 2768 KB Output isn't correct - L* = 0
31 Partially correct 22 ms 2856 KB Output isn't correct - L* = 0
32 Partially correct 20 ms 2784 KB Output isn't correct - L* = 0
33 Partially correct 21 ms 3024 KB Output isn't correct - L* = 0
34 Partially correct 28 ms 2804 KB Output isn't correct - L* = 0
35 Partially correct 22 ms 2776 KB Output isn't correct - L* = 0
36 Partially correct 22 ms 2768 KB Output isn't correct - L* = 0
37 Partially correct 20 ms 2868 KB Output isn't correct - L* = 0
38 Partially correct 24 ms 2748 KB Output isn't correct - L* = 0
39 Partially correct 22 ms 2780 KB Output isn't correct - L* = 0
40 Partially correct 20 ms 2752 KB Output isn't correct - L* = 0