답안 #345839

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
345839 2021-01-08T09:32:40 Z kshitij_sodani Broken Device (JOI17_broken_device) C++14
45 / 100
45 ms 3116 KB
//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first 
#define b second
#define endl '\n'

#include "Annalib.h"
int vis[151];
int ans[151];
void Anna( int n, long long x, int k, int pp[] ){
	for(int i=0;i<n;i++){
		vis[i]=0;
		ans[i]=0;
	}
	for(int i=0;i<k;i++){
		vis[pp[i]]=1;		
	}
	int cur=0;
	for(int i=0;i<n;i++){
		if(cur==60){
			break;
		}
		if(vis[i]==0){
			if(x&(1LL<<cur)){
				if(i%2==1){
					ans[i]=1;
					cur++;
				}
			}
			else{
				if(i%2==0){
					ans[i]=1;
					cur++;
				}
			}
		}
	}


	  for( int i = 0; i < n; i++ ){
	    Set( i, ans[i] );
	  }
}
//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first 
#define b second
#define endl '\n'


#include "Brunolib.h"

long long Bruno( int n, int aa[] ){


	vector<int> ss;
	llo ans=0;
	for(int i=0;i<n;i++){
		if(aa[i]==1){
			ss.pb(i);
		}
	}
	for(int i=0;i<ss.size();i++){
		if((ss[i]%2==1)){
			ans+=(1LL<<i);
		}
	}




  return ans;
}

//g++ -std=c++14 -O2 -o aa grader.cpp Anna.cpp Bruno.cpp

Compilation message

Bruno.cpp: In function 'long long int Bruno(int, int*)':
Bruno.cpp:24:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |  for(int i=0;i<ss.size();i++){
      |              ~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Partially correct 40 ms 3104 KB Output is partially correct - L* = 31
2 Partially correct 41 ms 2744 KB Output is partially correct - L* = 17
3 Partially correct 40 ms 2868 KB Output is partially correct - L* = 24
4 Partially correct 40 ms 2956 KB Output is partially correct - L* = 18
5 Partially correct 44 ms 3104 KB Output is partially correct - L* = 25
6 Partially correct 41 ms 3000 KB Output is partially correct - L* = 17
7 Partially correct 40 ms 2948 KB Output is partially correct - L* = 23
8 Partially correct 41 ms 3020 KB Output is partially correct - L* = 29
9 Partially correct 40 ms 3040 KB Output is partially correct - L* = 29
10 Partially correct 40 ms 2956 KB Output is partially correct - L* = 31
11 Partially correct 40 ms 2780 KB Output is partially correct - L* = 20
12 Partially correct 40 ms 3116 KB Output is partially correct - L* = 21
13 Partially correct 41 ms 2872 KB Output is partially correct - L* = 28
14 Partially correct 44 ms 2768 KB Output is partially correct - L* = 19
15 Partially correct 45 ms 2956 KB Output is partially correct - L* = 34
16 Partially correct 40 ms 2744 KB Output is partially correct - L* = 18
17 Partially correct 40 ms 2740 KB Output is partially correct - L* = 17
18 Partially correct 40 ms 2996 KB Output is partially correct - L* = 30
19 Partially correct 40 ms 2744 KB Output is partially correct - L* = 29
20 Partially correct 41 ms 2872 KB Output is partially correct - L* = 21
21 Partially correct 40 ms 2868 KB Output is partially correct - L* = 31
22 Partially correct 40 ms 2868 KB Output is partially correct - L* = 29
23 Partially correct 40 ms 2868 KB Output is partially correct - L* = 26
24 Partially correct 44 ms 2744 KB Output is partially correct - L* = 22
25 Partially correct 40 ms 2956 KB Output is partially correct - L* = 29
26 Partially correct 40 ms 2948 KB Output is partially correct - L* = 23
27 Partially correct 40 ms 2872 KB Output is partially correct - L* = 31
28 Partially correct 41 ms 2740 KB Output is partially correct - L* = 23
29 Partially correct 40 ms 2956 KB Output is partially correct - L* = 27
30 Partially correct 40 ms 2872 KB Output is partially correct - L* = 28
31 Partially correct 41 ms 2740 KB Output is partially correct - L* = 32
32 Partially correct 40 ms 2744 KB Output is partially correct - L* = 34
33 Partially correct 40 ms 2740 KB Output is partially correct - L* = 18
34 Partially correct 40 ms 2956 KB Output is partially correct - L* = 35
35 Partially correct 41 ms 2872 KB Output is partially correct - L* = 26
36 Partially correct 41 ms 2744 KB Output is partially correct - L* = 20
37 Partially correct 41 ms 2956 KB Output is partially correct - L* = 20
38 Partially correct 41 ms 3076 KB Output is partially correct - L* = 30
39 Partially correct 40 ms 2988 KB Output is partially correct - L* = 26
40 Partially correct 40 ms 2872 KB Output is partially correct - L* = 29