Submission #425806

# Submission time Handle Problem Language Result Execution time Memory
425806 2021-06-13T11:34:50 Z Apiram Cave (IOI13_cave) C++14
0 / 100
8 ms 460 KB
#include "cave.h"
#include<bits/stdc++.h>
using namespace std;
int flip(int i){
	if (i==0)return 1;
	return 0;
}
void exploreCave(int n) {
    //trycombination(s);
   int arr[n];
   vector<int>ans;
   int d[n];
   memset(arr,0,sizeof arr);
   memset(d,0,sizeof d);
    for (int i =0;i<n;++i){
    	ans.push_back(arr[i]);
    	int s[ans.size()];
    	for (int j=0;j<ans.size();++j){
    		s[j]=ans[j];
    	}
    	int a = tryCombination(s);
    	if (a==-1){
    	
    	ans[ans.size()-1]=flip(ans[ans.size()-1]);
    	s[ans.size()-1]=flip(ans[ans.size()-1]);
    	a=tryCombination(s);}
    	arr[i]=flip(ans.back());
    	d[i]=a;
    	ans[ans.size()-1]=flip(ans[ans.size()-1]);
    }
    answer(arr,d);
}

Compilation message

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:18:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |      for (int j=0;j<ans.size();++j){
      |                   ~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 332 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 460 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 332 KB Answer is wrong
2 Halted 0 ms 0 KB -