QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#79996 | #2920. Ultimate Binary Watch | perspective | AC ✓ | 2ms | 3712kb | C++23 | 2.2kb | 2023-02-21 16:40:29 | 2023-02-21 16:40:31 |
Judging History
answer
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define INP "input"
#define OUT "output"
/* some template */
template <typename T>
std::ostream& operator<<(std::ostream& out, const std::vector<T>& a) {
out << (int)a.size() << '\n';
for (const auto& v : a) out << v << ' ';
out << endl;
return out;
}
template <typename T>
std::ostream& operator<<(std::ostream& out, const std::vector<vector<T> >& a) {
out << (int)a.size() << '\n';
for (const auto& v : a) {
for (const auto& value : v) out << value << ' ';
out << endl;
}
return out;
}
template <typename T>
std::istream& operator>>(std::istream& is, std::vector<T>& v) {
for (auto& x : v) is >> x;
return is;
}
/* end template */
const long long INF_LL = 1e18;
const int INF = 1e9 + 100;
const long double EPS = 1e-6;
const int BLOCK = 550;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
void open_file() {
#ifdef THEMIS
freopen(INP ".txt", "r", stdin);
freopen(OUT ".txt", "w", stdout);
#endif // THEMIS
}
const int maxN = 1e6 + 100;
const int MOD = 1e9 + 7;
void sol() {
string t;
cin >> t;
vector<string> ans(4, string(9, ' '));
for (int i = 0; i < 4; i++) {
int d = t[i] - '0';
for (int j = 0; j < 4; j++) {
int offset = i >= 2 ? 2 : 0;
if ((d >> j) & 1)
ans[3 - j][2 * i + offset] = '*';
else
ans[3 - j][2 * i + offset] = '.';
}
}
for (int i = 0; i < 4; i++) cout << ans[i] << '\n';
}
void solve() {
clock_t start, end;
start = clock();
int T = 1;
// cin >> T;
int TestCase = 0;
while (T--) {
TestCase += 1;
cerr << "Processing test = " << TestCase << '\n';
// cout << "Case #" << TestCase << ": ";
sol();
// if (T) cout << '\n';
}
end = clock();
cerr << "Time = " << (double)(end - start) / (double)CLOCKS_PER_SEC << '\n';
}
int main(int argc, char* argv[]) {
// srand(time(nullptr));
ios_base::sync_with_stdio(0);
cin.tie(nullptr);
cout.tie(nullptr);
open_file();
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3652kb
input:
1234
output:
. . . . . . . * . * * . * . * .
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 2ms
memory: 3700kb
input:
0056
output:
. . . . . . * * . . . * . . * .
result:
ok 4 lines
Test #3:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
0708
output:
. . . * . * . . . * . . . * . .
result:
ok 4 lines
Test #4:
score: 0
Accepted
time: 2ms
memory: 3644kb
input:
0909
output:
. * . * . . . . . . . . . * . *
result:
ok 4 lines
Test #5:
score: 0
Accepted
time: 2ms
memory: 3632kb
input:
0000
output:
. . . . . . . . . . . . . . . .
result:
ok 4 lines
Test #6:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
0001
output:
. . . . . . . . . . . . . . . *
result:
ok 4 lines
Test #7:
score: 0
Accepted
time: 2ms
memory: 3608kb
input:
0100
output:
. . . . . . . . . . . . . * . .
result:
ok 4 lines
Test #8:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
2300
output:
. . . . . . . . * * . . . * . .
result:
ok 4 lines
Test #9:
score: 0
Accepted
time: 2ms
memory: 3712kb
input:
2359
output:
. . . * . . * . * * . . . * * *
result:
ok 4 lines
Test #10:
score: 0
Accepted
time: 2ms
memory: 3704kb
input:
1757
output:
. . . . . * * * . * . * * * * *
result:
ok 4 lines
Test #11:
score: 0
Accepted
time: 2ms
memory: 3636kb
input:
0959
output:
. * . * . . * . . . . . . * * *
result:
ok 4 lines
Test #12:
score: 0
Accepted
time: 2ms
memory: 3708kb
input:
2007
output:
. . . . . . . * * . . * . . . *
result:
ok 4 lines
Test #13:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
2244
output:
. . . . . . * * * * . . . . . .
result:
ok 4 lines
Test #14:
score: 0
Accepted
time: 2ms
memory: 3648kb
input:
1939
output:
. * . * . . . . . . * . * * * *
result:
ok 4 lines
Test #15:
score: 0
Accepted
time: 2ms
memory: 3576kb
input:
0117
output:
. . . . . . . * . . . * . * * *
result:
ok 4 lines
Test #16:
score: 0
Accepted
time: 2ms
memory: 3636kb
input:
0220
output:
. . . . . . . . . * * . . . . .
result:
ok 4 lines
Test #17:
score: 0
Accepted
time: 2ms
memory: 3648kb
input:
1354
output:
. . . . . . * * . * . . * * * .
result:
ok 4 lines
Test #18:
score: 0
Accepted
time: 2ms
memory: 3568kb
input:
1201
output:
. . . . . . . . . * . . * . . *
result:
ok 4 lines
Test #19:
score: 0
Accepted
time: 2ms
memory: 3572kb
input:
1902
output:
. * . . . . . . . . . * * * . .
result:
ok 4 lines
Test #20:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
2229
output:
. . . * . . . . * * * . . . . *
result:
ok 4 lines
Test #21:
score: 0
Accepted
time: 2ms
memory: 3572kb
input:
0749
output:
. . . * . * * . . * . . . * . *
result:
ok 4 lines
Test #22:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
1957
output:
. * . . . . * * . . . * * * * *
result:
ok 4 lines
Test #23:
score: 0
Accepted
time: 2ms
memory: 3708kb
input:
0019
output:
. . . * . . . . . . . . . . * *
result:
ok 4 lines
Test #24:
score: 0
Accepted
time: 2ms
memory: 3588kb
input:
1127
output:
. . . . . . . * . . * * * * . *
result:
ok 4 lines
Test #25:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
1502
output:
. . . . . * . . . . . * * * . .
result:
ok 4 lines
Test #26:
score: 0
Accepted
time: 2ms
memory: 3712kb
input:
1615
output:
. . . . . * . * . * . . * . * *
result:
ok 4 lines
Test #27:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
1900
output:
. * . . . . . . . . . . * * . .
result:
ok 4 lines
Test #28:
score: 0
Accepted
time: 2ms
memory: 3652kb
input:
0830
output:
. * . . . . . . . . * . . . * .
result:
ok 4 lines