#include<iostream>
using namespace std;
int main ()
{
int nbLignes, nbColonnes, totalModif = 0;
bool possible = true;
cin >> nbLignes >> nbColonnes;
for (int i = 0; i < nbColonnes - 1 && possible; i++)
{
char caseEnCours;
cin >> caseEnCours;
switch (caseEnCours)
{
case 'X':
cout << -1;
possible = false;
break;
case 'E':
break;
case 'N':
totalModif ++;
break;
case 'W':
totalModif += 2;
break;
case 'S':
totalModif += 3;
break;
}
}
if (possible)
{
cout << totalModif << endl;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
296 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
288 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
284 KB |
Output is correct |
4 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |