제출 #282505

#제출 시각아이디문제언어결과실행 시간메모리
282505mhy908기억 압축 (JOI15_memory)C++14
30 / 100
2892 ms284012 KiB
#include "Memory_lib.h" #include <bits/stdc++.h> using namespace std; int Memory(int N, int M){ if(N%2)return -2; int lv=M&127, l=(M>>7)&63, r=(M>>13)&63, tp=(M>>20)&1; if(lv>N/2||l>N||r>N)return -2; if(!l){ tp=-1; lv=0; } if(!lv){ if(r==N){ if(l)return -2; return -1; } char c=Get(++r); if(c=='['){ l=r; tp=0; } if(c=='<'){ l=r; tp=1; } if(c==']'){ if(tp!=0)return -2; l--; lv++; } if(c=='>'){ if(tp!=1)return -2; l--; lv++; } } else{ char c=Get(l--); if(c=='['){ lv--; if(!lv)tp=0, l++; } else if(c=='<'){ lv--; if(!lv)tp=1, l++; } else lv++; } return lv+(l<<7)+(r<<13)+(tp<<20); }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...