Submission #62258582


Source Code Expand

Copy
#include <bits/stdc++.h>
#define endl "\n"
#define N 500
using i64 = long long;
using namespace std;
void solve(){
string s;
cin>>s;
for(int i=0;i<s.size();i++){
if(s[i]=='N'){
cout<<"S";
}else if(s[i]=='S'){
cout<<"N";
}else if(s[i]=='E'){
cout<<"W";
}else{
cout<<"E";
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
#define endl "\n"
#define N 500
using i64 = long long;
using namespace std;


void solve(){
    string s;
	cin>>s;
	for(int i=0;i<s.size();i++){
		if(s[i]=='N'){
			cout<<"S";
		}else if(s[i]=='S'){
			cout<<"N";
		}else if(s[i]=='E'){
			cout<<"W";
		}else{
			cout<<"E";
		}
	}
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr),cout.tie(nullptr);
	solve();
	return 0;
}

Submission Info

Submission Time
Task A - Lucky Direction
User Enchantment
Language C++ 20 (gcc 12.2)
Score 100
Code Size 437 Byte
Status AC
Exec Time 1 ms
Memory 3484 KB

Compile Error

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

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 8
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt
All 00_sample_01.txt, 00_sample_02.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 3416 KB
00_sample_02.txt AC 1 ms 3280 KB
01_test_01.txt AC 1 ms 3432 KB
01_test_02.txt AC 1 ms 3376 KB
01_test_03.txt AC 1 ms 3464 KB
01_test_04.txt AC 1 ms 3416 KB
01_test_05.txt AC 1 ms 3484 KB
01_test_06.txt AC 1 ms 3304 KB


2025-04-05 (Sat)
17:47:41 +00:00