Submission #64081135


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;
#define ll long long
set<pair<ll,ll> >st;
int judge(ll r,ll c){
if(st.find({r,c})!=st.end()) return 1;
else return 0;
}
int main(){
ll n, r, c;
cin>>n>>r>>c;
string s;
cin>>s;
ll x=0, y=0;
st.insert({0,0});
for(int i=0;i<s.size();i++){
if(s[i]=='W'){
y+=1;
st.insert({x,y});
c+=1;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include<bits/stdc++.h>
using namespace std;
#define ll long long
set<pair<ll,ll> >st;
int judge(ll r,ll c){
	if(st.find({r,c})!=st.end()) return 1;
	else return 0;
}
int main(){
	ll n, r, c;
	cin>>n>>r>>c;
	string s;
	cin>>s;
	ll x=0, y=0;
	st.insert({0,0});
	for(int i=0;i<s.size();i++){
		if(s[i]=='W'){
			y+=1;
			st.insert({x,y});
			c+=1;
		}
		if(s[i]=='E'){
			y-=1;
			st.insert({x,y});
			c-=1;
		}
		if(s[i]=='N'){
			x+=1;
			st.insert({x,y});
			r+=1;
		}
		if(s[i]=='S'){
			x-=1;
			st.insert({x,y});
			r-=1;
		}
		cout<<judge(r,c);
	}
	cout<<"\n";
	return 0;
} 

Submission Info

Submission Time
Task D - Bonfire
User zhepei
Language C++ 20 (gcc 12.2)
Score 425
Code Size 619 Byte
Status AC
Exec Time 72 ms
Memory 16152 KB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:16:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   16 |         for(int i=0;i<s.size();i++){
      |                     ~^~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 425 / 425
Status
AC × 3
AC × 63
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt, test_36.txt, test_37.txt, test_38.txt, test_39.txt, test_40.txt, test_41.txt, test_42.txt, test_43.txt, test_44.txt, test_45.txt, test_46.txt, test_47.txt, test_48.txt, test_49.txt, test_50.txt, test_51.txt, test_52.txt, test_53.txt, test_54.txt, test_55.txt, test_56.txt, test_57.txt, test_58.txt, test_59.txt, test_60.txt
Case Name Status Exec Time Memory
sample_01.txt AC 1 ms 3536 KB
sample_02.txt AC 1 ms 3480 KB
sample_03.txt AC 1 ms 3676 KB
test_01.txt AC 39 ms 6212 KB
test_02.txt AC 40 ms 6480 KB
test_03.txt AC 40 ms 6404 KB
test_04.txt AC 1 ms 3476 KB
test_05.txt AC 38 ms 6156 KB
test_06.txt AC 38 ms 6980 KB
test_07.txt AC 38 ms 6368 KB
test_08.txt AC 1 ms 3608 KB
test_09.txt AC 36 ms 6260 KB
test_10.txt AC 32 ms 5440 KB
test_11.txt AC 35 ms 5660 KB
test_12.txt AC 1 ms 3552 KB
test_13.txt AC 33 ms 6120 KB
test_14.txt AC 31 ms 6640 KB
test_15.txt AC 34 ms 6648 KB
test_16.txt AC 1 ms 3628 KB
test_17.txt AC 30 ms 6192 KB
test_18.txt AC 30 ms 6496 KB
test_19.txt AC 30 ms 6224 KB
test_20.txt AC 7 ms 4144 KB
test_21.txt AC 33 ms 6668 KB
test_22.txt AC 33 ms 5904 KB
test_23.txt AC 31 ms 6264 KB
test_24.txt AC 30 ms 6496 KB
test_25.txt AC 60 ms 15968 KB
test_26.txt AC 72 ms 16016 KB
test_27.txt AC 72 ms 15908 KB
test_28.txt AC 72 ms 16044 KB
test_29.txt AC 58 ms 16116 KB
test_30.txt AC 58 ms 15912 KB
test_31.txt AC 71 ms 16032 KB
test_32.txt AC 69 ms 16036 KB
test_33.txt AC 71 ms 16048 KB
test_34.txt AC 72 ms 15956 KB
test_35.txt AC 58 ms 16060 KB
test_36.txt AC 71 ms 16152 KB
test_37.txt AC 71 ms 15980 KB
test_38.txt AC 69 ms 16112 KB
test_39.txt AC 58 ms 16032 KB
test_40.txt AC 56 ms 15988 KB
test_41.txt AC 39 ms 9040 KB
test_42.txt AC 39 ms 13708 KB
test_43.txt AC 43 ms 15876 KB
test_44.txt AC 45 ms 15700 KB
test_45.txt AC 40 ms 10336 KB
test_46.txt AC 35 ms 8568 KB
test_47.txt AC 43 ms 11176 KB
test_48.txt AC 36 ms 9572 KB
test_49.txt AC 38 ms 13672 KB
test_50.txt AC 45 ms 13500 KB
test_51.txt AC 39 ms 10948 KB
test_52.txt AC 41 ms 11208 KB
test_53.txt AC 41 ms 10260 KB
test_54.txt AC 41 ms 15580 KB
test_55.txt AC 42 ms 14980 KB
test_56.txt AC 45 ms 14240 KB
test_57.txt AC 39 ms 14096 KB
test_58.txt AC 35 ms 11776 KB
test_59.txt AC 34 ms 10300 KB
test_60.txt AC 39 ms 11724 KB


2025-04-26 (Sat)
18:27:44 +00:00