Submission #62259195


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll n;
void solve() {
string s;
cin >> s;
for(int i = 0; i < s.size(); i++){
if(s[i] == 'N') s[i] = 'S';
else if (s[i] == 'S') s[i] = 'N';
else if (s[i] == 'E') s[i] = 'W';
else if (s[i] == 'W') s[i] = 'E';
}
cout << s;
}
int main() {
cin.tie(0)->sync_with_stdio(0);
int tc = 1;
// cin >> tc;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll n;

void solve() {
    string s;
    cin >> s;
    for(int i = 0; i < s.size(); i++){
        if(s[i] == 'N') s[i] = 'S';
        else if (s[i] == 'S') s[i] = 'N';
        else if (s[i] == 'E') s[i] = 'W';
        else if  (s[i] == 'W') s[i] = 'E';
    }
    cout << s;
}
int main() {
    cin.tie(0)->sync_with_stdio(0);
    int tc = 1;
    // cin >> tc;
    while (tc--) solve();
}

Submission Info

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

Compile Error

Main.cpp: In function ‘void solve()’:
Main.cpp:10:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   10 |     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 3456 KB
00_sample_02.txt AC 1 ms 3508 KB
01_test_01.txt AC 1 ms 3512 KB
01_test_02.txt AC 1 ms 3476 KB
01_test_03.txt AC 1 ms 3428 KB
01_test_04.txt AC 1 ms 3380 KB
01_test_05.txt AC 1 ms 3516 KB
01_test_06.txt AC 1 ms 3440 KB


2025-03-07 (Fri)
17:19:44 +00:00