QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#274951#2920. Ultimate Binary Watchkonakarthik12AC ✓0ms3856kbC++234.8kb2023-12-04 08:48:412023-12-04 08:48:42

Judging History

你现在查看的是最新测评结果

  • [2023-12-04 08:48:42]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3856kb
  • [2023-12-04 08:48:41]
  • 提交

answer

#include <bits/stdc++.h>
// konakarthik12
// cpp20

using namespace std;

#define deb(...) (void) 0;

struct Reader {
  template <typename T>
  void operator()(T& obj) {
    cin >> obj;
  }
  
};
Reader rd;
struct WriterRaw {
  
  void __print_data(const char x) {
    cout << x;
  }
  
  void __print_data(const string x) {
    cout << x;
  }
  
  template <typename T>
  void operator()(const T x) {
    __print_data(x);
  }
  
};
WriterRaw wrr;

struct WriterSpace {
  void __print_data() {
    cout << " ";
  }
  
  void __print_data(const string x) {
    cout << x;
    __print_data();
  }
  
  template <typename T>
  void operator()(const T x) {
    __print_data(x);
  }
  
};
WriterSpace wrs;

struct Writer {
  
  template <typename T>
  void operator()(const T x) {
    wrs(x);
    wrr('\n');
  }
  
};
Writer wr;

// void init(int precision, string input_file, string output_file, bool force_redirection = false){
// if (applyfastio()) {
//   ios_base::sync_with_stdio(0);
//   cin.tie(0);
//   cout.tie(0);
// }

// if ((force_redirection || redirectIO()) && input_file.size() > 0) {
//   if (freopen(input_file.c_str(), "r", stdin)) {
//   };
// }
// if ((force_redirection || redirectIO()) && output_file.size() > 0) {
//   if (freopen(output_file.c_str(), "w", stdout)) {
//   };
// }
// wr.set_precision(precision);
// }
// void init() {
//   wr.set_precision(precision);
// }

// using BetterIO::rd;
// using BetterIO::wr;
// using BetterIO::wrf;
// using BetterIO::wrr;
// using BetterIO::wrs;
// using BetterIO::wrt;

// using BetterIO::print;
// using BetterIO::read;

template <class T>
using vec = vector<T>;
using vi = vec<int>;

// template <class T, class... Args>
// typename std::enable_if<has_value_type<T>::value, void>::type read(T x, Args&... args) {
// template <typename T, typename... Args>
// typename std::enable_if<true, void>::type read(T& x, Args&... args) {
//   cin >> x;
//   read(args...);
// }

// template <class T>
// void read(T arr[], int n) {
//   for (int i = 0; i < n; i++) {
//     read(arr[i]);
//   }
// }

// template <class T, typename... Args>
// void append(vec<T>& v, int n, Args&... args) {
//   v.reserve(v.size() + n);
//   for (int i = 0; i < n; i++) {
//     T temp;
//     read(temp);
//     v.push_back(temp);
//   }
//   read(args...);
// }
// template <class T, typename... Args>
// void read(vec<T>& v, int n, Args&... args) {
//   v.clear();
//   append(v, n, args...);
// }
// template <class T, typename... Args>
// void read(deque<T>& v, int n, Args&... args) {
//   v.clear();
//   for (int i = 0; i < n; i++) {
//     T temp;
//     read(temp);
//     v.push_back(temp);
//   }
//   read(args...);
// }
// template <class T, class V, typename... Args>
// void read(map<T, V>& m, int n, Args&... args) {
//   m.clear();
//   for (int i = 0; i < n; i++) {
//     T key;
//     V value;
//     read(key, value);
//     m[key] = value;
//   }
//   read(args...);
// }
// template <class T, class Comp = less<T>(), typename... Args>
// void read_count(map<T, int, Comp>& m, int n, Args&... args) {
//   m.clear();
//   for (int i = 0; i < n; i++) {
//     T temp;
//     read(temp);
//     m[temp]++;
//   }
//   read(args...);
// }
// vvi read_graph(int n, int m, bool directed = false) {
//   vvi adj(n + 1);
//   for (int i = 0; i < m; i++) {
//     int u, v;
//     read(u, v);
//     adj[u].pb(v);
//     if (!directed) {
//       adj[v].pb(u);
//     }
//   }
//   return adj;
// }
// vvi read_tree(int n) {
//   return read_graph(n, n - 1);
// }
// vvpii read_graph_weighted(int n, int m, bool directed = false) {
//   vvpii adj(n + 1);
//   for (int i = 0; i < m; i++) {
//     int u, v, w;
//     read(u, v, w);
//     adj[u].eb(v, w);
//     if (!directed) {
//       adj[v].eb(u, w);
//     }
//   }
//   return adj;
// }

// void read1(string& s) {
//   read(s);
//   s = '*' + s;
// }

// template <class ForwardIt>
// constexpr std::pair<typename std::iterator_traits<ForwardIt>::value_type,
//                     typename std::iterator_traits<ForwardIt>::value_type>
// lowhigh(ForwardIt first, ForwardIt last) {
//   auto [low, high] = std::minmax_element(first, last);
//   return {*low, *high};
// }

void solve();

int main() {
  cin.tie(0)->sync_with_stdio(false);
  cout << fixed << setprecision(15);

  solve();
  cout.flush();
  return 0;
}

void solve() {
  string s;
  rd(s);
  deb(s);
  vec<string> ans(4, string(9, ' '));
  using bset = bitset<4>;
  vi col{0, 2, 6, 8};
  for (int i = 0; i < 4; i++) {
    bset d = s[i] - '0';
    deb(d);
    for (int j = 0; j < 4; j++) {
      ans[3 - j][col[i]] = d[j] ? '*' : '.';
    }
  }
  for (int i = 0; i < 3; i++) {
    wr(ans[i]);
  }
  wrr(ans.back());
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3768kb

input:

1234

output:

. .   . . 
. .   . * 
. *   * . 
* .   * .

result:

ok 4 lines

Test #2:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

0056

output:

. .   . . 
. .   * * 
. .   . * 
. .   * .

result:

ok 4 lines

Test #3:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

0708

output:

. .   . * 
. *   . . 
. *   . . 
. *   . .

result:

ok 4 lines

Test #4:

score: 0
Accepted
time: 0ms
memory: 3500kb

input:

0909

output:

. *   . * 
. .   . . 
. .   . . 
. *   . *

result:

ok 4 lines

Test #5:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

0000

output:

. .   . . 
. .   . . 
. .   . . 
. .   . .

result:

ok 4 lines

Test #6:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

0001

output:

. .   . . 
. .   . . 
. .   . . 
. .   . *

result:

ok 4 lines

Test #7:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

0100

output:

. .   . . 
. .   . . 
. .   . . 
. *   . .

result:

ok 4 lines

Test #8:

score: 0
Accepted
time: 0ms
memory: 3844kb

input:

2300

output:

. .   . . 
. .   . . 
* *   . . 
. *   . .

result:

ok 4 lines

Test #9:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

2359

output:

. .   . * 
. .   * . 
* *   . . 
. *   * *

result:

ok 4 lines

Test #10:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

1757

output:

. .   . . 
. *   * * 
. *   . * 
* *   * *

result:

ok 4 lines

Test #11:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

0959

output:

. *   . * 
. .   * . 
. .   . . 
. *   * *

result:

ok 4 lines

Test #12:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

2007

output:

. .   . . 
. .   . * 
* .   . * 
. .   . *

result:

ok 4 lines

Test #13:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

2244

output:

. .   . . 
. .   * * 
* *   . . 
. .   . .

result:

ok 4 lines

Test #14:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

1939

output:

. *   . * 
. .   . . 
. .   * . 
* *   * *

result:

ok 4 lines

Test #15:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

0117

output:

. .   . . 
. .   . * 
. .   . * 
. *   * *

result:

ok 4 lines

Test #16:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

0220

output:

. .   . . 
. .   . . 
. *   * . 
. .   . .

result:

ok 4 lines

Test #17:

score: 0
Accepted
time: 0ms
memory: 3772kb

input:

1354

output:

. .   . . 
. .   * * 
. *   . . 
* *   * .

result:

ok 4 lines

Test #18:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

1201

output:

. .   . . 
. .   . . 
. *   . . 
* .   . *

result:

ok 4 lines

Test #19:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

1902

output:

. *   . . 
. .   . . 
. .   . * 
* *   . .

result:

ok 4 lines

Test #20:

score: 0
Accepted
time: 0ms
memory: 3652kb

input:

2229

output:

. .   . * 
. .   . . 
* *   * . 
. .   . *

result:

ok 4 lines

Test #21:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

0749

output:

. .   . * 
. *   * . 
. *   . . 
. *   . *

result:

ok 4 lines

Test #22:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

1957

output:

. *   . . 
. .   * * 
. .   . * 
* *   * *

result:

ok 4 lines

Test #23:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

0019

output:

. .   . * 
. .   . . 
. .   . . 
. .   * *

result:

ok 4 lines

Test #24:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

1127

output:

. .   . . 
. .   . * 
. .   * * 
* *   . *

result:

ok 4 lines

Test #25:

score: 0
Accepted
time: 0ms
memory: 3724kb

input:

1502

output:

. .   . . 
. *   . . 
. .   . * 
* *   . .

result:

ok 4 lines

Test #26:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

1615

output:

. .   . . 
. *   . * 
. *   . . 
* .   * *

result:

ok 4 lines

Test #27:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

1900

output:

. *   . . 
. .   . . 
. .   . . 
* *   . .

result:

ok 4 lines

Test #28:

score: 0
Accepted
time: 0ms
memory: 3656kb

input:

0830

output:

. *   . . 
. .   . . 
. .   * . 
. .   * .

result:

ok 4 lines