Task: | Kasihymiö |
Sender: | SeveriK |
Submission time: | 2018-01-14 19:23:52 +0200 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | TIME LIMIT EXCEEDED | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.05 s | 1 | details |
#2 | ACCEPTED | 0.05 s | 1 | details |
#3 | WRONG ANSWER | 0.04 s | 1 | details |
#4 | ACCEPTED | 0.05 s | 1 | details |
#5 | ACCEPTED | 0.04 s | 1 | details |
#6 | TIME LIMIT EXCEEDED | -- | 2 | details |
#7 | ACCEPTED | 0.10 s | 2 | details |
#8 | TIME LIMIT EXCEEDED | -- | 2 | details |
#9 | TIME LIMIT EXCEEDED | -- | 2 | details |
#10 | TIME LIMIT EXCEEDED | -- | 2 | details |
Code
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <algorithm> using namespace std; typedef unsigned int uint; typedef unsigned long ul; typedef unsigned long long ull; typedef long long ll; typedef long double ld; #define PI 3.1415926535897932384626433 int main() { uint output = 0; string input = ""; std::cin >> input; for (uint i = 0; i < input.length(); i++) { if (input[i] == '8') { uint nextI = 0; for (uint o = i + 1; o < input.length(); o++) { if (input[o] == ')') { output++; } else if(nextI == 0) { nextI = o - 1; } } if (nextI != 0) { i = nextI; } } } std::cout << output << "\n"; int w; std::cin >> w; return 0; }
Test details
Test 1
Group: 1
Verdict: ACCEPTED
input |
---|
888888888888888888888888888888... |
correct output |
---|
0 |
user output |
---|
0 |
Test 2
Group: 1
Verdict: ACCEPTED
input |
---|
))))))))))))))))))))))))))))))... |
correct output |
---|
0 |
user output |
---|
0 |
Test 3
Group: 1
Verdict: WRONG ANSWER
input |
---|
888888888888888888888888888888... |
correct output |
---|
250000 |
user output |
---|
249500 |
Test 4
Group: 1
Verdict: ACCEPTED
input |
---|
8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)... |
correct output |
---|
125250 |
user output |
---|
125250 |
Test 5
Group: 1
Verdict: ACCEPTED
input |
---|
8)88))))88))8)))8))8))888))888... |
correct output |
---|
127050 |
user output |
---|
127050 |
Test 6
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
888888888888888888888888888888... |
correct output |
---|
0 |
user output |
---|
(empty) |
Test 7
Group: 2
Verdict: ACCEPTED
input |
---|
))))))))))))))))))))))))))))))... |
correct output |
---|
0 |
user output |
---|
0 |
Test 8
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
888888888888888888888888888888... |
correct output |
---|
250000000000 |
user output |
---|
(empty) |
Test 9
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)... |
correct output |
---|
125000250000 |
user output |
---|
(empty) |
Test 10
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
888)888))8)88)8))88)888)88))8)... |
correct output |
---|
125162819188 |
user output |
---|
(empty) |