Task: | Kyselyt |
Sender: | SeveriK |
Submission time: | 2017-10-03 19:05:00 +0300 |
Language: | C++ |
Status: | READY |
Result: | 12 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 12 |
#2 | TIME LIMIT EXCEEDED | 0 |
#3 | TIME LIMIT EXCEEDED | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.10 s | 1 | details |
#2 | TIME LIMIT EXCEEDED | -- | 2 | details |
#3 | TIME LIMIT EXCEEDED | -- | 3 | details |
Code
/* #include <iostream> #include <string> using namespace std; int main() { for (int i = 0; i < 10; i++) { string curRow = ""; for (int o = 0; o < 10; o++) { int n = i + o; if (n > 9) { n -= 10; } curRow += to_string(n); n = o - i; if (n < 0) { n += 10; } if (n == 0) { curRow += "A "; } else if (n == 1) { curRow += "B "; } else if (n == 2) { curRow += "C "; } else if (n == 3) { curRow += "D "; } else if (n == 4) { curRow += "E "; } else if (n == 5) { curRow += "F "; } else if (n == 6) { curRow += "G "; } else if (n == 7) { curRow += "H "; } else if (n == 8) { curRow += "I "; } else if (n == 9) { curRow += "J "; } } cout << curRow << "\n"; } int a; cin >> a; return 0; }*/ //Tehtävä 5 /* #include <iostream> #include <string> using namespace std; int main() { string input = ""; cin >> input; bool modifyDone = false, modified = false, deleteNext = false; string output = ""; char lastChar = ' '; while (!modifyDone) { lastChar = ' '; output = ""; deleteNext = false; modified = false; for (unsigned int i = 0; i < input.length(); i++) { if (i != 0) { if (input[i] == lastChar && (!modified || deleteNext)) { if (!deleteNext) { output.pop_back(); deleteNext = true; modified = true; } } else { deleteNext = false; output += input[i]; lastChar = input[i]; } } else { lastChar = input[i]; output += input[i]; } } if (!modified || output.length() <= 0) { modifyDone = true; } else { input = output; } } cout << output << "\n"; int a; cin >> a; return 0; }*/ //Tehtävä 1 #include <iostream> #include <string> using namespace std; int main() { unsigned int q = 0; cin >> q; for (unsigned int i = 0; i < q; i++) { unsigned int k = 0; cin >> k; string nums = ""; for(int o = 1; nums.length() < k; o++) { nums += to_string(o); } cout << nums[k - 1] << "\n"; } int a; cin >> a; return 0; } //Tehtävä 3
Test details
Test 1
Group: 1
Verdict: ACCEPTED
input |
---|
1000 582 214 723 273 ... |
correct output |
---|
0 1 7 7 6 ... |
user output |
---|
0 1 7 7 6 ... Truncated |
Test 2
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000 615664 916441 627600 279508 ... |
correct output |
---|
1 2 3 2 2 ... |
user output |
---|
(empty) |
Test 3
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000 672274832941907421 260504693279721732 646999966092970935 100853063389774434 ... |
correct output |
---|
7 2 2 0 9 ... |
user output |
---|
(empty) |