113922024-09-05 02:54:53nooneMorze (60 pont)cpp17Accepted 60/603ms616 KiB
#include <bits/stdc++.h>

using namespace std;

int main() {
  cin.tie(0)->sync_with_stdio(0);
  map<int, int> lookup;
  lookup[0b00000] = 0;
  lookup[0b10000] = 1;
  lookup[0b11000] = 2;
  lookup[0b11100] = 3;
  lookup[0b11110] = 4;
  lookup[0b11111] = 5;
  lookup[0b01111] = 6;
  lookup[0b00111] = 7;
  lookup[0b00011] = 8;
  lookup[0b00001] = 9;
  char c[5];
  int idx;
  while(cin >> c[0] >> c[1] >> c[2] >> c[3] >> c[4]) {
    idx = 0;
    for(int i = 0; i < 5; ++i)
      idx |= ((c[i] - '-') & 1) << (4 - i);
    cout << lookup[idx];
  }
  return 0;
}
SubtaskSumTestVerdictTimeMemory
base60/60
1Accepted0/02ms548 KiB
2Accepted0/03ms360 KiB
3Accepted3/33ms616 KiB
4Accepted3/33ms360 KiB
5Accepted3/32ms444 KiB
6Accepted3/33ms516 KiB
7Accepted3/33ms540 KiB
8Accepted3/33ms496 KiB
9Accepted4/42ms504 KiB
10Accepted4/43ms360 KiB
11Accepted4/43ms428 KiB
12Accepted7/73ms376 KiB
13Accepted7/72ms508 KiB
14Accepted8/83ms360 KiB
15Accepted8/83ms364 KiB