QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#259641#5261. Kolorowy wążmikefeng0 76ms20260kbC++141.7kb2023-11-21 09:03:422023-11-21 09:03:44

Judging History

你现在查看的是最新测评结果

  • [2023-11-21 09:03:44]
  • 评测
  • 测评结果:0
  • 用时:76ms
  • 内存:20260kb
  • [2023-11-21 09:03:42]
  • 提交

answer

bool M1;
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<iomanip>
#include<cassert>
#include<random>
#include<cstdio>
#include<vector>
#include<bitset>
#include<stack>
#include<queue>
#include<deque>
#include<cmath>
#include<ctime>
#include<map>
#include<set>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/hash_policy.hpp>
//#include<ext/pb_ds/priority_queue.hpp>
#define fi first
#define se second
#define LD double
#define ll long long
#define Vector Point
#define I128 __int128
#define ull unsigned ll
#define pii pair<int,int>
#define pb(x) push_back(x)
#define syt cerr<<"sytakioi\n"
#define F(i,a,b) for(int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(int i=a,i##end=b;i>=i##end;--i)
#define look_memory cerr<<abs(&M2-&M1)/1024.0/1024<<'\n'
#define rd_i(l,r) uniform_int_distribution<int>(l,r)(rd)
#define rd_r(l,r) uniform_real_distribution<double>(l,r)(rd)
#define look_time cerr<<(clock()-Time)*1.0/CLOCKS_PER_SEC<<'\n'
using namespace std;
//using namespace __gnu_cxx;
mt19937 rd(time(0));
const int N=2005;
int m,p,n,cnt,x=1,y=1;
int a[N][N],t[N][N];
bool M2;
int main(){
	int Time=clock();
	look_memory;
	cin.tie(nullptr)->sync_with_stdio(false);
	cin>>m>>p>>n;
	memset(t,-1,sizeof t);
	t[1][1]=0;
	F(i,1,p){
		int x,y,val;cin>>x>>y>>val;
		a[x][y]=val;
	}
	vector<int> v={0};
	F(i,1,n){
		char c;cin>>c;
		if(c=='Z'){
			int x,y;cin>>x>>y;
			if(cnt-t[x][y]<v.size()) cout<<v[v.size()-(cnt-t[x][y])-1]<<'\n';
			else cout<<"-1\n";
		}else{
			if(c=='G') --x;
			if(c=='D') ++x;
			if(c=='L') --y;
			if(c=='P') ++y;
			t[x][y]=++cnt;
			if(a[x][y]) v.emplace_back(a[x][y]),a[x][y]=0;
		}
	}
	look_time;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 19424kb

input:

2 3 2000
2 1 2
1 2 0
2 2 3
P
D
L
Z 1 2
G
Z 2 1
P
Z 2 2
Z 2 1
D
L
Z 2 1
G
P
D
Z 1 2
L
G
P
D
Z 2 2
L
Z 2 2
Z 2 2
Z 2 1
Z 1 2
Z 2 2
G
P
D
L
G
P
D
L
G
P
Z 1 1
D
L
Z 1 1
Z 1 1
Z 1 2
G
Z 2 2
P
D
L
G
Z 1 2
Z 1 2
P
Z 1 1
D
L
Z 1 1
G
P
D
L
G
P
Z 2 1
D
L
Z 1 1
Z 2 2
G
P
D
L
G
Z 2 1
Z 1 1
Z 2 2
P
D
L
G
Z 1 1
P...

output:

0
3
-1
0
2
3
2
3
3
2
0
3
3
-1
-1
0
0
-1
-1
3
-1
0
-1
3
3
2
0
2
-1
2
3
3
0
2
0
0
2
0
2
-1
-1
3
0
2
3
0
-1
-1
2
3
3
0
-1
-1
2
2
0
3
2
-1
-1
0
-1
2
2
0
2
2
2
2
3
0
3
2
3
-1
2
0
3
3
-1
3
2
3
-1
3
3
2
-1
0
2
0
0
3
0
0
0
2
2
3
3
0
3
0
2
2
-1
-1
2
-1
3
0
-1
2
3
-1
2
-1
2
0
-1
0
2
-1
2
3
-1
2
0
2
3
-1
2
0
2...

result:

wrong answer 3rd lines differ - expected: '0', found: '-1'

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 76ms
memory: 20260kb

input:

200 1000 1000000
193 196 0
110 183 0
78 72 0
160 46 0
185 62 0
61 56 0
122 60 0
79 188 0
100 171 0
112 60 0
141 191 0
122 58 0
79 181 0
28 24 0
115 121 0
26 17 0
103 89 0
100 138 0
58 5 0
97 174 0
137 40 0
112 104 0
45 142 0
187 17 0
45 135 0
193 152 0
13 178 0
174 36 0
157 196 0
104 55 0
165 46 0
1...

output:

0
0
0
0
-1
0
0
0
0
-1
0
0
0
0
-1
0
0
0
0
-1
0
-1
-1
0
0
0
0
0
0
0
0
0
0
-1
0
0
0
0
-1
-1
-1
0
-1
-1
-1
0
0
-1
-1
-1
-1
0
0
-1
-1
-1
0
-1
-1
-1
0
-1
-1
-1
-1
-1
0
0
-1
-1
0
-1
-1
-1
-1
-1
-1
0
0
-1
-1
0
-1
-1
0
-1
-1
0
-1
0
0
-1
0
0
0
0
-1
-1
-1
-1
-1
-1
-1
0
0
-1
-1
0
-1
-1
-1
-1
-1
-1
-1
0
0
-1
0
0...

result:

wrong answer 39th lines differ - expected: '0', found: '-1'

Subtask #4:

score: 0
Skipped

Dependency #1:

0%