# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
282182 |
2020-08-24T05:59:00 Z |
최은수(#5756) |
None (JOI15_memory) |
C++17 |
|
2918 ms |
283812 KB |
#include"Memory_lib.h"
#include<iostream>
#include<vector>
#include<algorithm>
#define ep emplace
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const int inf=1e9+7;
const ll INF=1e18;
int Memory(int N,int M)
{
if(N%2==1)
return-2;
int cur=M/4096/(N/2);
int ssz=M/4096%(N/2);
int stv=M%4096;
if(cur>=N||ssz>cur)
return-2;
char c=Get(cur+1);
if(c=='<'||c=='[')
stv+=(c=='<'?0:1)<<ssz++;
else
{
if(ssz==0)
return-2;
ssz--;
int v=c=='>'?0:1;
if((stv>>ssz&1)!=v)
return-2;
stv-=v<<ssz;
}
if(ssz>N/2)
return-2;
if(cur==N-1)
return ssz==0?-1:-2;
return stv+ssz*4096+(cur+1)*4096*(N/2);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2812 ms |
283636 KB |
Output is correct |
2 |
Incorrect |
2918 ms |
283812 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2812 ms |
283636 KB |
Output is correct |
2 |
Incorrect |
2918 ms |
283812 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2812 ms |
283636 KB |
Output is correct |
2 |
Incorrect |
2918 ms |
283812 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2812 ms |
283636 KB |
Output is correct |
2 |
Incorrect |
2918 ms |
283812 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Wrong Answer [1] |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2812 ms |
283636 KB |
Output is correct |
2 |
Incorrect |
2918 ms |
283812 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |