QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#57719#2920. Ultimate Binary Watchwtcherr#AC ✓3ms3720kbC++202.3kb2022-10-22 18:04:482022-10-22 18:04:49

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-22 18:04:49]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3720kb
  • [2022-10-22 18:04:48]
  • 提交

answer

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define IO ios_base::sync_with_stdio(0), cin.tie(0)
const int mod = 1e9 + 7;
template <typename T>
void readArray(vector<T> &A)
{
    for (T &i : A)
        cin >> i;
}
template <typename T>
void readArray(vector<vector<T>> &A)
{
    for (vector<T> &i : A)
        readArray(i);
}
template <typename T>
void printArray(vector<T> A)
{
    for (T i : A)
        cout << i << " ";
    cout << endl;
}
ll fastPow(ll a, ll b, ll m = mod)
{
    a %= m;
    ll res = 1;
    while (b > 0)
    {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}
bool isPrime(ll n, int iter = 5)
{
    if (n < 4)
        return n == 2 || n == 3;
    for (int i = 0; i < iter; i++)
    {
        int a = 2 + rand() % (n - 3);
        if (fastPow(a, n - 1, n) != 1)
            return false;
    }
    return true;
}
ll inv(ll n, ll m = mod)
{
    return fastPow(n, m - 2);
}
ll mul(ll a, ll b, ll m = mod)
{
    return (a * b) % m;
}
ll add(ll a, ll b, ll m = mod)
{
    return (a + b + m) % m;
}
void solve()
{
    string s;
    cin >> s;
    vector<vector<char>> A(4, vector<char>(4, '.'));
    for (int i = 0; i < 4; i++)
    {
        for (int bit = 3; bit >= 0; bit--)
        {
            if ((s[i] - '0') >> bit & 1)
                A[3 - bit][i] = '*';
        }
    }
    for (int i = 0; i < 4; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            cout << A[i][j] << " ";
            if (j == 1)
                cout << "  ";
        }
        cout << endl;
    }
}
void trials()
{
    int t, tt;
    for (cin >> t, tt = t; t--; cout << endl)
    {
        // cout << "Case #" << tt - t << ": ";
        solve();
    }
}
int main()
{
    // freopen("","r",stdin);
    IO;
    solve();
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3496kb

input:

1234

output:

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

result:

ok 4 lines

Test #2:

score: 0
Accepted
time: 2ms
memory: 3496kb

input:

0056

output:

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

result:

ok 4 lines

Test #3:

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

input:

0708

output:

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

result:

ok 4 lines

Test #4:

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

input:

0909

output:

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

result:

ok 4 lines

Test #5:

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

input:

0000

output:

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

result:

ok 4 lines

Test #6:

score: 0
Accepted
time: 2ms
memory: 3628kb

input:

0001

output:

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

result:

ok 4 lines

Test #7:

score: 0
Accepted
time: 2ms
memory: 3492kb

input:

0100

output:

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

result:

ok 4 lines

Test #8:

score: 0
Accepted
time: 2ms
memory: 3704kb

input:

2300

output:

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

result:

ok 4 lines

Test #9:

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

input:

2359

output:

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

result:

ok 4 lines

Test #10:

score: 0
Accepted
time: 2ms
memory: 3548kb

input:

1757

output:

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

result:

ok 4 lines

Test #11:

score: 0
Accepted
time: 2ms
memory: 3640kb

input:

0959

output:

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

result:

ok 4 lines

Test #12:

score: 0
Accepted
time: 2ms
memory: 3636kb

input:

2007

output:

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

result:

ok 4 lines

Test #13:

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

input:

2244

output:

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

result:

ok 4 lines

Test #14:

score: 0
Accepted
time: 2ms
memory: 3532kb

input:

1939

output:

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

result:

ok 4 lines

Test #15:

score: 0
Accepted
time: 2ms
memory: 3708kb

input:

0117

output:

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

result:

ok 4 lines

Test #16:

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

input:

0220

output:

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

result:

ok 4 lines

Test #17:

score: 0
Accepted
time: 2ms
memory: 3608kb

input:

1354

output:

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

result:

ok 4 lines

Test #18:

score: 0
Accepted
time: 2ms
memory: 3536kb

input:

1201

output:

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

result:

ok 4 lines

Test #19:

score: 0
Accepted
time: 2ms
memory: 3720kb

input:

1902

output:

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

result:

ok 4 lines

Test #20:

score: 0
Accepted
time: 2ms
memory: 3492kb

input:

2229

output:

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

result:

ok 4 lines

Test #21:

score: 0
Accepted
time: 2ms
memory: 3548kb

input:

0749

output:

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

result:

ok 4 lines

Test #22:

score: 0
Accepted
time: 2ms
memory: 3672kb

input:

1957

output:

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

result:

ok 4 lines

Test #23:

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

input:

0019

output:

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

result:

ok 4 lines

Test #24:

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

input:

1127

output:

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

result:

ok 4 lines

Test #25:

score: 0
Accepted
time: 2ms
memory: 3496kb

input:

1502

output:

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

result:

ok 4 lines

Test #26:

score: 0
Accepted
time: 2ms
memory: 3628kb

input:

1615

output:

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

result:

ok 4 lines

Test #27:

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

input:

1900

output:

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

result:

ok 4 lines

Test #28:

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

input:

0830

output:

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

result:

ok 4 lines