Submission #59268

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
592682018-07-21 11:20:26TadijaSebezCave (IOI13_cave)C++11
100 / 100
610 ms640 KiB
#include "cave.h"
#include <stdio.h>
#include <vector>
using namespace std;
#define pb push_back
const int N=5005;
int id[N],ty[N];
int mask[N],n,good[N],k[N];
bool done[N];
/*int lid[N],tid[N];
int ok[N];
int tryCombination(int a[])
{
int i;
for(i=0;i<n;i++) ok[lid[i]]=a[i]==tid[i];
for(i=0;i<n;i++) if(!ok[i]) return i;
return -1;
}
void answer(int a[], int id[])
{
int i;
for(i=0;i<n;i++) printf("%i ",a[i]);printf("\n");
for(i=0;i<n;i++) printf("%i ",id[i]);printf("\n");
}*/
int get(int a[]){ int x=tryCombination(a);if(x==-1) return n;return x;}
void exploreCave(int N)
{
n=N;
int x=get(mask),y;
int i,j;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:51:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(j=0;j<pos.size();j++) tmp[j&1].pb(pos[j]);
            ~^~~~~~~~~~~
cave.cpp:52:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(j=0;j<tmp[0].size();j++) good[tmp[0][j]]^=1;
            ~^~~~~~~~~~~~~~
cave.cpp:64:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(j=0;j<tmp[0].size();j++) good[tmp[0][j]]^=1;
            ~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...