Task: | Merkkijono |
Sender: | Uolevi |
Submission time: | 2017-11-20 16:16:23 +0200 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | RUNTIME ERROR | 0 |
test | verdict | time | |
---|---|---|---|
#1 | RUNTIME ERROR | 0.05 s | details |
#2 | RUNTIME ERROR | 0.03 s | details |
#3 | RUNTIME ERROR | 0.03 s | details |
#4 | RUNTIME ERROR | 0.04 s | details |
#5 | RUNTIME ERROR | 0.04 s | details |
#6 | RUNTIME ERROR | 0.04 s | details |
#7 | RUNTIME ERROR | 0.04 s | details |
#8 | RUNTIME ERROR | 0.03 s | details |
#9 | RUNTIME ERROR | 0.05 s | details |
#10 | RUNTIME ERROR | 0.04 s | details |
Code
#include <iostream> #include <bits/stdc++.h> #include <string> #include <algorithm> using namespace std; int n; int vastaus = 0; int lasku = 0; int vali = 0; int vali2 = 0; int main(){ cin >> n; for(int i=0;unsigned(i)<100000000;i+=10){ string s = to_string(i); for(int j=0;unsigned(j)<s.size();j++){if(s[j]=='1') vali++;} vastaus += 10*vali+1; if(vastaus>n){ vastaus -= 10*vali+1; for(int j=0;j<10;j++){ for (int x=0;unsigned(x)<to_string(j+i).size();x++){if(to_string(j+i)[x]=='1'){ vali2++;}} if(vastaus + vali2 > n){cout << i+j-1; return true;} else{vastaus+=vali2;} vali2 = 0; } } vali = 0; } return true; }
Test details
Test 1
Verdict: RUNTIME ERROR
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
ABABABABABABABABABABABABABABAB... |
user output |
---|
0 |
Test 2
Verdict: RUNTIME ERROR
input |
---|
AABBAABBAABBAABBAABBAABBAABBAA... |
correct output |
---|
(empty) |
user output |
---|
0 |
Test 3
Verdict: RUNTIME ERROR
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
(empty) |
user output |
---|
0 |
Test 4
Verdict: RUNTIME ERROR
input |
---|
BBABABBBBBAABBBABABABBBBAAABAB... |
correct output |
---|
BAB |
user output |
---|
0 |
Test 5
Verdict: RUNTIME ERROR
input |
---|
ACDCBBACDBBBACAACBBDBADBAABABA... |
correct output |
---|
ACDCACDADBADABACACDCADADABABCA... |
user output |
---|
0 |
Test 6
Verdict: RUNTIME ERROR
input |
---|
EETFHIJOGACDHMGVFJCMETMZDEITTR... |
correct output |
---|
TFHIJOGACDHMGVFJCMETMZDEIROTET... |
user output |
---|
0 |
Test 7
Verdict: RUNTIME ERROR
input |
---|
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB... |
correct output |
---|
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE... |
user output |
---|
0 |
Test 8
Verdict: RUNTIME ERROR
input |
---|
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS... |
correct output |
---|
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK... |
user output |
---|
0 |
Test 9
Verdict: RUNTIME ERROR
input |
---|
QUVVTPXAMWWODFXRONJODPGBTCISGM... |
correct output |
---|
QUTPXAMODFXRONJODPGBTCISGMVRBW... |
user output |
---|
0 |
Test 10
Verdict: RUNTIME ERROR
input |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
correct output |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
user output |
---|
0 |