Submission #101182

# Submission time Handle Problem Language Result Execution time Memory
101182 2019-03-17T09:00:15 Z Pro_ktmr None (JOI15_memory) C++14
0 / 100
1437 ms 127352 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(now > N) return -2;
    if(now == N){
        if(length != 0) return -2;
        roopCount++;
        now = 0;
        return roopCount << 15;
    }
    if(roopCount > N) return -2;
    if(roopCount == N) return -1;

    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;
}
# Verdict Execution time Memory Grader output
1 Incorrect 946 ms 108648 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 946 ms 108648 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 946 ms 108648 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 946 ms 108648 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1437 ms 127352 KB Wrong Answer [1]
# Verdict Execution time Memory Grader output
1 Incorrect 946 ms 108648 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -