Submission #29263

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
292632017-07-18 20:44:29osmanorhanParrots (IOI11_parrots)C++14
81 / 100
15 ms2448 KiB
#include "encoder.h"
#include "encoderlib.h"
#include<cmath>
#include<cstdio>
#include<bits/stdc++.h>
bool a[9];
void encode(int N, int M[])
{
int sum=0;
// printf("hebele\n");
for(int i=0; i<N; i++) {
for(int b=0; b<9; b++) a[b] = false;
int n = M[i];
int msg=i;
// printf("%d sayi var i=%d\n",N, i);
msg = msg<<2;
// printf("msg %d\n", msg);
//n sayisi ikilik tabana donusturule
for(int j=7; j>-1; j--) {
if( n>=(1<<j) ) {
a[j] = true;
// printf("%d true\n", j);
n-=1<<j;
}
}
for(int j=0; j<4; j++) {
if(a[2*j] and a[2*j+1]) { sum+=3; }
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:57:13: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
             if( !v )send(255); send(255); send(255); send(255);
             ^~
encoder.cpp:57:32: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
             if( !v )send(255); send(255); send(255); send(255);
                                ^~~~
encoder.cpp:63:83: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
                 else if(a[2*j+1]) {/*printf("%d 1 kere\n", j);  */send(msg+j); sen++;}
                                                                                   ^~
#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...