1 solutions
-
0
C++ :
#include <iostream> #include <cstdio> #include <cmath> using namespace std; void f(string s, int score) { int w = 0, l = 0; for (int i = 0; i < s.size(); i++){ if (s[i] == 'E') break; if (s[i] == 'W') w ++; if (s[i] == 'L') l ++; if ((w>=score || l>=score) && abs(w-l)>=2) { printf("%d:%d\n", w, l); w = l = 0; } } printf("%d:%d\n\n", w, l); } int main() { string s, str; while (cin >> str) { s += str; } f(s, 11); f(s, 21); return 0; }
- 1
Information
- ID
- 17306
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By