QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#718600 | #3567. Digital Clock | Odyssey | 0 | 44ms | 3524kb | C++17 | 2.5kb | 2024-11-06 20:56:03 | 2024-11-06 20:56:07 |
Judging History
answer
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
const int N = 1e6 + 9;
int n;
int digit[] = {
0b1111110, // 0
0b0110000, // 1
0b1101101, // 2
0b1111001, // 3
0b0110011, // 4
0b1011011, // 5
0b1011111, // 6
0b1110000, // 7
0b1111111, // 8
0b1111011 // 9
};
bool isson(const string& look, const string& real) {
for (int i = 0; i <= 4; i++) {
if (i == 2) continue;
int x = look[i] - '0', y = real[i] - '0';
if ((digit[x] & digit[y]) != digit[x]) {
return false;
}
}
return true;
}
vector<string> all(int n, const vector<string>& ob) {
vector<string> res;
for (int i = 0; i < 24; i++) {
for (int j = 0; j < 60; j++) {
int h = i, m = j;
bool flag = true;
string now, start, tmp;
for (int cnt = 0; cnt < n; cnt++) {
/*ostringstream oss;
oss << setfill('0') << setw(2) << h << ':' << setfill('0') << setw(2) << m;
now = oss.str();*/
string t1, t2;
if (h < 10)t1 = '0';
t1+=to_string(h);
if(m<10)t2 = '0';
t2+= to_string(m);
now = t1 + ':' + t2;
/* cout << now << endl;
cout << tmp << endl;
if (now != tmp)cout << "sssssssssssssssssss" << endl;*/
if (cnt == 0) start = now;
if (!isson(ob[cnt], now)) {
flag = false;
break;
}
m++;
if (m == 60) {
m = 0;
h = (h + 1) % 24;
}
}
if (flag) {
res.push_back(start);
}
}
}
return res;
}
void solve() {
while (cin >> n) {
vector<string> ob(n);
for (int i = 0; i < n; i++) {
cin >> ob[i];
}
vector<string> ans = all(n, ob);
if (ans.empty()) {
cout << "none\n";
}
else {
for (size_t i = 0; i < ans.size(); i++) {
if (i > 0) cout << " ";
cout << ans[i];
}
cout << "\n";
}
}
}
int main() {
IOS;
solve();
return 0;
}
详细
Pretests
Final Tests
Test #1:
score: 0
Wrong Answer
time: 44ms
memory: 3524kb
input:
1 88:88 2 23:25 23:26 3 71:57 71:57 71:07 1 00:00 1 11:11 1 22:22 1 33:33 1 44:44 1 55:55 1 66:66 1 77:77 1 88:88 1 99:99 1 08:28 1 78:48 1 24:11 1 31:11 1 11:60 5 23:11 23:11 23:11 23:11 23:11 6 23:11 23:11 23:11 23:11 23:11 23:11 6 23:11 23:11 23:11 23:11 23:11 23:12 2 08:19 08:20 2 27:77 27:17 2 ...
output:
none 23:25 00:58 03:58 07:58 08:58 00:00 00:08 08:00 08:08 00:00 00:01 00:03 00:04 00:07 00:08 00:09 00:10 00:11 00:13 00:14 00:17 00:18 00:19 00:30 00:31 00:33 00:34 00:37 00:38 00:39 00:40 00:41 00:43 00:44 00:47 00:48 00:49 01:00 01:01 01:03 01:04 01:07 01:08 01:09 01:10 01:11 01:13 01:14 01:17 0...
result:
wrong answer 21st lines differ - expected: 'none', found: '23:07 23:37'