답안 #199131

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
199131 2020-01-29T13:32:02 Z arnold518 기억 압축 (JOI15_memory) C++14
0 / 100
561 ms 53736 KB
#include "Memory_lib.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int Memory(int N, int M)
{
	int i, j;

	int pos=M%1000, val=M/1000;

	if(pos>=N)
	{
		if(val==0) return -1;
		return -2;
	}

	assert(pos+1<=N);
	char t=Get(pos+1);
	if(t=='<') val++;
	else val--;
	pos++;

	if(val<0) return -2;

	return val*1000+pos;
}

Compilation message

memory.cpp: In function 'int Memory(int, int)':
memory.cpp:11:6: warning: unused variable 'i' [-Wunused-variable]
  int i, j;
      ^
memory.cpp:11:9: warning: unused variable 'j' [-Wunused-variable]
  int i, j;
         ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 561 ms 53736 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 561 ms 53736 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 561 ms 53736 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 561 ms 53736 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 376 KB Wrong Answer [1]
# 결과 실행 시간 메모리 Grader output
1 Incorrect 561 ms 53736 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -