19 lines
469 B
C++
19 lines
469 B
C++
#include <cstdint>
|
|
#include <fstream>
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
int main() {
|
|
std::fstream inputFile("input");
|
|
std::string currentLine;
|
|
int16_t counter = 50, number = 0, password = 0;
|
|
|
|
while (std::getline(inputFile, currentLine)) {
|
|
number = std::stoi(currentLine.substr(1));
|
|
counter = (counter + ((currentLine[0] == 'L') * 2 - 1) * number) % 100;
|
|
password += counter == 0 ? 1 : 0;
|
|
}
|
|
std::cout << password << std::endl;
|
|
return 0;
|
|
}
|