| Task: | Lista |
| Sender: | Anniiiz |
| Submission time: | 2022-01-22 16:36:09 +0200 |
| Language: | C++ (C++11) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| #2 | WRONG ANSWER | 0 |
| #3 | WRONG ANSWER | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
| #2 | WRONG ANSWER | 0.01 s | 2, 3 | details |
| #3 | WRONG ANSWER | 0.01 s | 3 | details |
| #4 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
| #5 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
| #6 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
| #7 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
| #8 | WRONG ANSWER | 0.01 s | 3 | details |
| #9 | WRONG ANSWER | 0.01 s | 3 | details |
| #10 | WRONG ANSWER | 0.01 s | 3 | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:25:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int j = 0; j < s.size(); j++) {
~~^~~~~~~~~~
input/code.cpp:33:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (k[i-1] == s.size()) {
~~~~~~~^~~~~~~~~~~
input/code.cpp:51:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
else if (!a || s.size() < k[i-1]) {
~~~~~~~~~^~~~~~~~
input/code.cpp:55:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (s.size() == k[i-1]) {
~~~~~~~~~^~~~~~~~~
input/code.cpp:58:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int j = 0; j < s.size(); ++j) {
~~^~~~~~~~~~
input/code.cpp:86:29: warning: comparison between signed and u...Code
#include <iostream>
#include <vector>
#include<algorithm>
#include <map>
using namespace std;
using ll = long long;
vector<ll> lista;
int t[10001][10];
int k[1001];
vector<string> alku;
int main() {
ll n;
string s;
cin >> n;
ll f = 0;
for (int i = 0; i < n; ++i) {
cin >> s;
alku.push_back(s);
//if (i != 0) cout << lista.back() << endl;
ll a = 0;
ll suurempi = 0;
ll pienempi = 0;
k[i] = s.size();
for (int j = 0; j < s.size(); j++) {
//cout << "xd" << endl;
if (s[j] == '?') {
a++;
t[i][j] = 10;
}
else {
t[i][j] = s[j]-'0';
if (k[i-1] == s.size()) {
if (t[i-1][j] > t[i][j]) {
if (!pienempi && !suurempi) {
suurempi = j;
}
}
else {
pienempi++;
}
}
}
}
//cout << "toimiiko" << endl;
if (!a && (i == 0 || stoi(s) > lista.back())) {
//cout << "lol" << endl;
lista.push_back(stoi(s));
continue;
}
else if (!a || s.size() < k[i-1]) {
f++;
break;
}
if (s.size() == k[i-1]) {
//cout << "täällä" << endl;
string e = "";
for (int j = 0; j < s.size(); ++j) {
//cout << e << endl;
if (t[i][j] == 10) {
e += to_string(t[i-1][j]);
t[i][j] = t[i-1][j];
}
else {
e += to_string(t[i][j]);
}
}
//cout << e << endl;
if (suurempi) {
ll l = 0;
ll kohta = 10;
for (int j = suurempi-1; j >= 0; j--) {
if (alku[i][j] == '?' && t[i][j] != 9) {
l++;
kohta = j;
break;
}
}
if (!l) {
f++;
break;
}
else {
t[i][kohta]++;
e = "";
for (int j = 0; j < s.size(); ++j) {
e += to_string(t[i][j]);
}
}
}
if (stoi(e) <= lista.back()) {
//cout << "melkeen ongelma" << endl;
ll l = 0;
ll kohta = 10;
for (int j = s.size()-1; j >= 0; j--) {
//cout << alku[i][j] << " " << t[i][j] << endl;
if (alku[i][j] == '?' && t[i][j] != 9) {
l++;
kohta = j;
break;
}
}
//cout << kohta << " " << t[i][kohta] << endl;
if (!l) {
f++;
break;
}
else {
t[i][kohta]++;
e = "";
for (int j = 0; j < s.size(); ++j) {
//cout << e << endl;
e += to_string(t[i][j]);
}
//cout << e << endl;
}
}
lista.push_back(stoi(e));
}
else if (s.size() > k[i-1]) {
string e = "";
for (int j = 0; j < s.size(); ++j) {
if (t[i][j] == 10) {
if (j == 0) {
e += '1';
t[i][j] = 1;
}
else {
t[i][j] = 0;
e += '0';
}
}
else e += to_string(t[i][j]);
}
lista.push_back(stoi(e));
}
}
for (int i = 1; i < lista.size(); i++) {
if (lista[i-1] >= lista[i]) {
f++;
break;
}
}
if (f) cout << "IMPOSSIBLE" << endl;
else {
for (auto u : lista) {
cout << u << endl;
}
}
}
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 100 ?? ?? ?? ?? ... |
| correct output |
|---|
| 10 11 12 13 20 ... |
| user output |
|---|
| IMPOSSIBLE |
Test 2
Group: 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 1000 8?? ??8? ???? ???? ... |
| correct output |
|---|
| 800 1080 1081 1082 1083 ... |
| user output |
|---|
| IMPOSSIBLE |
Test 3
Group: 3
Verdict: WRONG ANSWER
| input |
|---|
| 1000 ?????? ?????9? ??98??? ?????5? ... |
| correct output |
|---|
| 100000 1000090 1098000 1098050 4100001 ... |
| user output |
|---|
| IMPOSSIBLE |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 100 ? ? ? ? ... |
| correct output |
|---|
| 1 2 3 4 5 ... |
| user output |
|---|
| IMPOSSIBLE |
Test 5
Group: 1, 2, 3
Verdict: ACCEPTED
| input |
|---|
| 2 ??? ?? |
| correct output |
|---|
| IMPOSSIBLE |
| user output |
|---|
| IMPOSSIBLE |
Test 6
Group: 1, 2, 3
Verdict: ACCEPTED
| input |
|---|
| 3 123 ??? 124 |
| correct output |
|---|
| IMPOSSIBLE |
| user output |
|---|
| IMPOSSIBLE |
Test 7
Group: 1, 2, 3
Verdict: ACCEPTED
| input |
|---|
| 5 1?? ??? 2?? ??? ... |
| correct output |
|---|
| IMPOSSIBLE |
| user output |
|---|
| IMPOSSIBLE |
Test 8
Group: 3
Verdict: WRONG ANSWER
| input |
|---|
| 1000 ????????? ????????? ????????? ????????? ... |
| correct output |
|---|
| 100000000 100000001 100000002 100000003 100000004 ... |
| user output |
|---|
| IMPOSSIBLE |
Test 9
Group: 3
Verdict: WRONG ANSWER
| input |
|---|
| 900 ???000000 ???000000 ???000000 ???000000 ... |
| correct output |
|---|
| 100000000 101000000 102000000 103000000 104000000 ... |
| user output |
|---|
| IMPOSSIBLE |
Test 10
Group: 3
Verdict: WRONG ANSWER
| input |
|---|
| 1000 ???1????? ???0????? ???1????? ???0????? ... |
| correct output |
|---|
| 100100000 101000000 101100000 102000000 102100000 ... |
| user output |
|---|
| IMPOSSIBLE |
