제출 #57619

#제출 시각아이디문제언어결과실행 시간메모리
57619kimjg1119앵무새 (IOI11_parrots)C++17
0 / 100
7 ms2112 KiB
#include <stdio.h>
#include "encoder.h"
#include "encoderlib.h"

void encode(int N, int M[])
{
  int i;
  int a[64];
  int b, c, d, e;
  for(i=0; i<N; i++)
  {
      b=M[i]/64;
      c=(M[i]%64)/16;
      d=(M[i]%16)/4;
      e=M[i]%4;
      a[i*4]=b+16*i;
      a[i*4+1]=c+4+16*i;
      a[i*4+2]=d+8+16*i;
      a[i*4+3]=e+12+16*i;

  }
  for(i=0; i<N*4; i++)
  {
      printf("%d ", a[i]);
  }
  for(i=0; i<N*4; i++)
    send(a[i]);
    return;
}
#include <stdio.h>
#include "decoder.h"
#include "decoderlib.h"

int power(int n, int m)
{
    int ans=1;
    for(int i=0; i<m; i++)
        ans=ans*n;
    return ans;
}

void decode(int N, int L, int X[])
{
    int i, b, temp1, temp2, temp3;
    int temp[16]={};
    for(i=0; i<L; i++)
    {
        temp1=X[i]%4;
        temp2=(X[i]%16)/4;
        temp3=X[i]/16;
        temp[temp3]+=temp1*power(4, 3-temp2);
    }
    for(i=0; i<L/4; i++)
    {
        printf("%d ", temp[i]);
    }
    for(i=0; i<L/4; i++)
    {
        b = temp[i];
        output(b);
    }
}

컴파일 시 표준 에러 (stderr) 메시지

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:26:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   for(i=0; i<N*4; i++)
   ^~~
encoder.cpp:28:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
     return;
     ^~~~~~
#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...