Submission #775884

# Submission time Handle Problem Language Result Execution time Memory
775884 2023-07-07T05:59:26 Z vjudge1 Awesome Arrowland Adventure (eJOI19_adventure) C++17
0 / 100
1 ms 212 KB
#include<bits/stdc++.h>
using namespace std;
#define lalala ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl "\n"
#define ll long long
#define pb push_back
#define N 2000005
int main(){
	lalala;
	int n,m;cin>>n>>m;
	int arr[n][m];
	int yes=0;
	int w,e,no;w=e=no=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			char a;cin>>a;
			if(a=='S')continue;	
			else if(a=='W')w++;	
			else if(a=='E')e++;			
			else if(a=='N')no++;
			else {
				if(i!=n-1)yes=1;
				arr[i][j]=0;
			}
		}
	}
	if(yes){
		cout<<-1<<endl;
		return 0;
	}
	ll int ans=0;
	ans=(no*2)+(w*3)+e;
	cout<<ans<<endl;



}

Compilation message

adventure.cpp: In function 'int main()':
adventure.cpp:11:6: warning: variable 'arr' set but not used [-Wunused-but-set-variable]
   11 |  int arr[n][m];
      |      ^~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -