QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#102375 | #2920. Ultimate Binary Watch | tsbeehismail | AC ✓ | 3ms | 3520kb | C++20 | 2.2kb | 2023-05-03 11:59:26 | 2023-05-03 11:59:29 |
Judging History
answer
#include <iostream>
#include <array>
#include <algorithm>
#include <cmath>
#include <vector>
#include <iomanip>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <cstdio>
#include <queue>
#include <cstring>
#include <bitset>
#include <numeric>
using namespace std;
#define endl '\n'
#define loop(i, k, n) for(ll i = k; i<n; i++)
#define loopr(i, k, n) for(ll i = k; i >= n; i--)
#define clr(v, d) memset(v, d, sizeof(v))
#define fx(x) fixed << setprecision(x)
#define sz(s) (ll)s.size()
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define f first
#define s second
#define pi acos(-1)
#define test int test; cin >> test; while(test--)
#define ON(n, k) ((n) | (1<<(k)))
#define OFF(n, k) ((n) & ~(1<<(k)))
#define isON(n, k) (((n)>>(k)) & 1)
#define isPow2(n) !(n & (n-1))
#define sum(n) (n*(n+1)/2)
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
template<typename T=int>ostream&operator<<(ostream&out,const vector<T>&v){
for(const T&x:v)out<<x<<' '; return out;}
void init(){
cin.tie(nullptr);
istream::sync_with_stdio(false);
}
const ll N = 2e5 + 5, M = 105, mod = 1e9 + 7, OO = 1e18;
int dx[] = {-1, 1, 2, -2, -1, 1, 2, -2};
int dy[] = {2, 2, -1, -1, -2, -2, 1, 1};
char ans[4][4];
void solve() {
string s; cin >> s;
loop(i, 0, sz(s)){
if(s[i] == '1') ans[3][i] = '*';
else if(s[i] == '2') ans[2][i] = '*';
else if(s[i] == '3') ans[3][i] = '*', ans[2][i] = '*';
else if(s[i] == '4') ans[1][i] = '*';
else if(s[i] == '5') ans[3][i] = '*', ans[1][i] = '*';
else if(s[i] == '6') ans[2][i] = '*', ans[1][i] = '*';
else if(s[i] == '7') ans[3][i] = '*', ans[2][i] = '*', ans[1][i] = '*';
else if(s[i] == '8') ans[0][i] = '*';
else if(s[i] == '9') ans[3][i] = '*', ans[0][i] = '*';
}
loop(i, 0, 4){
loop(j, 0, 4){
if(ans[i][j] != '*') cout << ". ";
else cout << ans[i][j] << ' ';
if(j == 1) cout << ' ';
}
cout << endl;
}
}
int main() {
init();
//freopen("window.in","r",stdin);
//test {
solve();
//}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3416kb
input:
1234
output:
. . . . . . . * . * * . * . * .
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3408kb
input:
0056
output:
. . . . . . * * . . . * . . * .
result:
ok 4 lines
Test #3:
score: 0
Accepted
time: 0ms
memory: 3452kb
input:
0708
output:
. . . * . * . . . * . . . * . .
result:
ok 4 lines
Test #4:
score: 0
Accepted
time: 0ms
memory: 3416kb
input:
0909
output:
. * . * . . . . . . . . . * . *
result:
ok 4 lines
Test #5:
score: 0
Accepted
time: 1ms
memory: 3452kb
input:
0000
output:
. . . . . . . . . . . . . . . .
result:
ok 4 lines
Test #6:
score: 0
Accepted
time: 2ms
memory: 3460kb
input:
0001
output:
. . . . . . . . . . . . . . . *
result:
ok 4 lines
Test #7:
score: 0
Accepted
time: 2ms
memory: 3412kb
input:
0100
output:
. . . . . . . . . . . . . * . .
result:
ok 4 lines
Test #8:
score: 0
Accepted
time: 2ms
memory: 3500kb
input:
2300
output:
. . . . . . . . * * . . . * . .
result:
ok 4 lines
Test #9:
score: 0
Accepted
time: 0ms
memory: 3420kb
input:
2359
output:
. . . * . . * . * * . . . * * *
result:
ok 4 lines
Test #10:
score: 0
Accepted
time: 0ms
memory: 3404kb
input:
1757
output:
. . . . . * * * . * . * * * * *
result:
ok 4 lines
Test #11:
score: 0
Accepted
time: 2ms
memory: 3404kb
input:
0959
output:
. * . * . . * . . . . . . * * *
result:
ok 4 lines
Test #12:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
2007
output:
. . . . . . . * * . . * . . . *
result:
ok 4 lines
Test #13:
score: 0
Accepted
time: 2ms
memory: 3400kb
input:
2244
output:
. . . . . . * * * * . . . . . .
result:
ok 4 lines
Test #14:
score: 0
Accepted
time: 0ms
memory: 3400kb
input:
1939
output:
. * . * . . . . . . * . * * * *
result:
ok 4 lines
Test #15:
score: 0
Accepted
time: 0ms
memory: 3412kb
input:
0117
output:
. . . . . . . * . . . * . * * *
result:
ok 4 lines
Test #16:
score: 0
Accepted
time: 2ms
memory: 3408kb
input:
0220
output:
. . . . . . . . . * * . . . . .
result:
ok 4 lines
Test #17:
score: 0
Accepted
time: 3ms
memory: 3388kb
input:
1354
output:
. . . . . . * * . * . . * * * .
result:
ok 4 lines
Test #18:
score: 0
Accepted
time: 2ms
memory: 3388kb
input:
1201
output:
. . . . . . . . . * . . * . . *
result:
ok 4 lines
Test #19:
score: 0
Accepted
time: 2ms
memory: 3472kb
input:
1902
output:
. * . . . . . . . . . * * * . .
result:
ok 4 lines
Test #20:
score: 0
Accepted
time: 1ms
memory: 3416kb
input:
2229
output:
. . . * . . . . * * * . . . . *
result:
ok 4 lines
Test #21:
score: 0
Accepted
time: 0ms
memory: 3416kb
input:
0749
output:
. . . * . * * . . * . . . * . *
result:
ok 4 lines
Test #22:
score: 0
Accepted
time: 1ms
memory: 3504kb
input:
1957
output:
. * . . . . * * . . . * * * * *
result:
ok 4 lines
Test #23:
score: 0
Accepted
time: 2ms
memory: 3468kb
input:
0019
output:
. . . * . . . . . . . . . . * *
result:
ok 4 lines
Test #24:
score: 0
Accepted
time: 2ms
memory: 3512kb
input:
1127
output:
. . . . . . . * . . * * * * . *
result:
ok 4 lines
Test #25:
score: 0
Accepted
time: 2ms
memory: 3516kb
input:
1502
output:
. . . . . * . . . . . * * * . .
result:
ok 4 lines
Test #26:
score: 0
Accepted
time: 0ms
memory: 3416kb
input:
1615
output:
. . . . . * . * . * . . * . * *
result:
ok 4 lines
Test #27:
score: 0
Accepted
time: 0ms
memory: 3380kb
input:
1900
output:
. * . . . . . . . . . . * * . .
result:
ok 4 lines
Test #28:
score: 0
Accepted
time: 2ms
memory: 3520kb
input:
0830
output:
. * . . . . . . . . * . . . * .
result:
ok 4 lines