CSES - KILO 2016 3/5 - Results
Submission details
Task:Time bomb
Sender:Team Olari
Submission time:2016-09-20 16:52:24 +0300
Language:C++
Status:READY
Result:ACCEPTED
Test results
testverdicttime
#1ACCEPTED0.06 sdetails
#2ACCEPTED0.05 sdetails
#3ACCEPTED0.05 sdetails
#4ACCEPTED0.06 sdetails
#5ACCEPTED0.05 sdetails
#6ACCEPTED0.06 sdetails
#7ACCEPTED0.05 sdetails
#8ACCEPTED0.06 sdetails
#9ACCEPTED0.05 sdetails
#10ACCEPTED0.08 sdetails
#11ACCEPTED0.06 sdetails
#12ACCEPTED0.05 sdetails
#13ACCEPTED0.05 sdetails
#14ACCEPTED0.06 sdetails
#15ACCEPTED0.06 sdetails
#16ACCEPTED0.05 sdetails
#17ACCEPTED0.05 sdetails
#18ACCEPTED0.05 sdetails
#19ACCEPTED0.06 sdetails
#20ACCEPTED0.05 sdetails

Code

#include <iostream>

using namespace std;

string s[5];
string a[5]= {
  "###...#.###.###.#.#.###.###.###.###.###",
  "#.#...#...#...#.#.#.#...#.....#.#.#.#.#",
  "#.#...#.###.###.###.###.###...#.###.###",
  "#.#...#.#.....#...#...#.#.#...#.#.#...#",
  "###...#.###.###...#.###.###...#.###.###"
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  for(int i=0; i<5; ++i) cin >> s[i];
  int n=s[0].size();
  int V=0;
  for(int i=0; i<n; i+=4){
    V*=10;
    for(int j=0; j<=9; ++j){
      int b=4*j;
      bool f=true;
      for(int k=0; k<3; ++k){
        for(int l=0; l<5; ++l){
          if(s[l][i+k]!=a[l][b+k]) f=false;
        }
      }
      if(f==true) {
        V+=j;
        break;
      }
    }
  }
  if(V%97==0) cout << "BEER!!\n";
  else cout << "BOOM!\n";
}

Test details

Test 1

Verdict: ACCEPTED

input
###.###...#
..#.#.#...#
###.###...#
#.....#...#
###.###...#

correct output
BEER!!

user output
BEER!!

Test 2

Verdict: ACCEPTED

input
###.#.#.###
#...#.#...#
###.###.###
..#...#...#
###...#.###

correct output
BOOM!

user output
BOOM!

Test 3

Verdict: ACCEPTED

input
###.###.###.###.###.#.#.###
#.#.#.....#.#.#...#.#.#.#.#
###.###...#.#.#.###.###.###
#.#.#.#...#.#.#.#.....#.#.#
###.###...#.###.###...#.###

correct output
BEER!!

user output
BEER!!

Test 4

Verdict: ACCEPTED

input
###.#.#.###.###.###.###.###.##...

correct output
BOOM!

user output
BOOM!

Test 5

Verdict: ACCEPTED

input
###.###.###.###.#.#.###.###
#.#.#.#.#.#.#.#.#.#.#...#..
###.###.###.###.###.###.###
#.#...#...#...#...#.#.#.#.#
###.###.###.###...#.###.###

correct output
BEER!!

user output
BEER!!

Test 6

Verdict: ACCEPTED

input
###...#.#.#.###.###.###.###......

correct output
BOOM!

user output
BOOM!

Test 7

Verdict: ACCEPTED

input
#.#.###.###.###.###...#.###
#.#.#.....#.#...#.#...#.#.#
###.###.###.###.#.#...#.###
..#.#.#...#.#.#.#.#...#.#.#
..#.###.###.###.###...#.###

correct output
BEER!!

user output
BEER!!

Test 8

Verdict: ACCEPTED

input
#.#.###.#.#.###.###.###.###.##...

correct output
BOOM!

user output
BOOM!

Test 9

Verdict: ACCEPTED

input
###.###.###.###.###.###.###
#.#...#.#.#...#.#.....#.#.#
###.###.###.###.###.###.###
#.#.#...#.#.#.....#...#...#
###.###.###.###.###.###.###

correct output
BEER!!

user output
BEER!!

Test 10

Verdict: ACCEPTED

input
###.#.#.###.###.###.###.#.#.##...

correct output
BOOM!

user output
BOOM!

Test 11

Verdict: ACCEPTED

input
..#.###...#.###.###.###.###
..#.#.....#.#...#.#.#...#.#
..#.###...#.###.#.#.###.#.#
..#.#.#...#...#.#.#...#.#.#
..#.###...#.###.###.###.###

correct output
BEER!!

user output
BEER!!

Test 12

Verdict: ACCEPTED

input
..#.###.###.###.#.#...#.#.#.##...

correct output
BOOM!

user output
BOOM!

Test 13

Verdict: ACCEPTED

input
###.###.###.###...#...#
..#...#.#.#...#...#...#
###.###.###.###...#...#
#...#.....#.#.....#...#
###.###.###.###...#...#

correct output
BEER!!

user output
BEER!!

Test 14

Verdict: ACCEPTED

input
###.###.###.#.#.###.###.###.##...

correct output
BOOM!

user output
BOOM!

Test 15

Verdict: ACCEPTED

input
###.###.###.###.###.###.###
#...#...#.....#.#.#...#...#
###.###.###.###.#.#.###...#
#.#.#.#.#.#...#.#.#.#.....#
###.###.###.###.###.###...#

correct output
BEER!!

user output
BEER!!

Test 16

Verdict: ACCEPTED

input
..#.###.###.###.###.###.###.##...

correct output
BOOM!

user output
BOOM!

Test 17

Verdict: ACCEPTED

input
###.#.#.###.###...#.###.###
#.#.#.#.#.#...#...#.#.#.#.#
###.###.###.###...#.#.#.###
..#...#.#.#...#...#.#.#.#.#
###...#.###.###...#.###.###

correct output
BEER!!

user output
BEER!!

Test 18

Verdict: ACCEPTED

input
###.###.###.###...#.###.###.##...

correct output
BOOM!

user output
BOOM!

Test 19

Verdict: ACCEPTED

input
###.###...#.###.#.#.###.###
..#.#.#...#...#.#.#...#...#
..#.###...#.###.###...#...#
..#.#.#...#.#.....#...#...#
..#.###...#.###...#...#...#

correct output
BEER!!

user output
BEER!!

Test 20

Verdict: ACCEPTED

input
###.#.#.###.###.###.###.#.#.##...

correct output
BOOM!

user output
BOOM!