답안 #101185

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
101185 2019-03-17T09:06:42 Z Pro_ktmr 기억 압축 (JOI15_memory) C++14
0 / 100
2629 ms 276708 KB
#include"Memory_lib.h"

int Memory(int N, int M){
    int roopCount = M >> 15;
    int now = (M >> 8) % (1 << 7);
    int length = (M >> 1) % (1 << 7);
    int stack = M % (1 << 1);
    if(roopCount > N) return 0;
    if(roopCount == N) return -1;
    if(now > N) return 0;
    if(now == N){
        if(length != 0) return -2;
        roopCount++;
        return roopCount << 15;
    }

    char c = Get(now+1);
    if(c == '<'){
        if(length == roopCount) stack = 0;
        length++;
    }
    if(c == '['){
        if(length == roopCount) stack = 1;
        length++;
    }
    if(c == '>'){
        length--;
        if(length == roopCount && stack != 0) return -2;
    }
    if(c == ']'){
        length--;
        if(length == roopCount && stack != 1) return -2;
    }

    now++;
    return (roopCount<<15) + (now<<8) + (length<<1) + stack;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2629 ms 276708 KB Output is correct
2 Correct 2561 ms 276620 KB Output is correct
3 Incorrect 2536 ms 276564 KB Wrong Answer [6]
# 결과 실행 시간 메모리 Grader output
1 Correct 2629 ms 276708 KB Output is correct
2 Correct 2561 ms 276620 KB Output is correct
3 Incorrect 2536 ms 276564 KB Wrong Answer [6]
# 결과 실행 시간 메모리 Grader output
1 Correct 2629 ms 276708 KB Output is correct
2 Correct 2561 ms 276620 KB Output is correct
3 Incorrect 2536 ms 276564 KB Wrong Answer [6]
# 결과 실행 시간 메모리 Grader output
1 Correct 2629 ms 276708 KB Output is correct
2 Correct 2561 ms 276620 KB Output is correct
3 Incorrect 2536 ms 276564 KB Wrong Answer [6]
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2522 ms 276460 KB Wrong Answer [6]
# 결과 실행 시간 메모리 Grader output
1 Correct 2629 ms 276708 KB Output is correct
2 Correct 2561 ms 276620 KB Output is correct
3 Incorrect 2536 ms 276564 KB Wrong Answer [6]