Submission #199135

# Submission time Handle Problem Language Result Execution time Memory
199135 2020-01-29T14:14:27 Z arnold518 None (JOI15_memory) C++14
10 / 100
2738 ms 284048 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) return -2;
	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+pos*1000;
}

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;
         ^
# Verdict Execution time Memory Grader output
1 Correct 2738 ms 283896 KB Output is correct
2 Incorrect 2580 ms 284048 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2738 ms 283896 KB Output is correct
2 Incorrect 2580 ms 284048 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2738 ms 283896 KB Output is correct
2 Incorrect 2580 ms 284048 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2738 ms 283896 KB Output is correct
2 Incorrect 2580 ms 284048 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2677 ms 283888 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2738 ms 283896 KB Output is correct
2 Incorrect 2580 ms 284048 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -