Task: | Merkkijono |
Sender: | Shrike |
Submission time: | 2017-10-03 10:58:06 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.03 s | details |
#2 | ACCEPTED | 0.04 s | details |
#3 | ACCEPTED | 0.04 s | details |
#4 | WRONG ANSWER | 0.05 s | details |
#5 | WRONG ANSWER | 0.04 s | details |
#6 | WRONG ANSWER | 0.05 s | details |
#7 | WRONG ANSWER | 0.04 s | details |
#8 | WRONG ANSWER | 0.05 s | details |
#9 | WRONG ANSWER | 0.04 s | details |
#10 | WRONG ANSWER | 0.04 s | details |
Compiler report
input/code.cpp: In function 'int main(int, char**)': input/code.cpp:58:6: warning: variable 'inth' set but not used [-Wunused-but-set-variable] ll inth, nth, dec, s, sm, num; ^
Code
#include <iostream> #include <cmath> using namespace std; typedef long long ll; ll decade(ll n) { ll sum; sum = 0; for (int i = 1; i < 1000000; i++) { if (sum + i*9*pow(10.0, i-1) > n) return i; else sum += i*9*pow(10.0, i-1); } return 0; } ll nnum(ll dec, ll nth) { return (ll)(pow(10.0, (int)dec-1)-1+nth); } ll sums(ll decade) { ll sum; sum = 0; for (int i = 1; i < decade; i++) sum += i*9*pow(10.0, i-1); return sum; } int dig(int a, int b) { int i, digit; digit = 1; for(i = b-1; i > 0; i++) digit = digit*10; digit = (a/digit) % 10; return digit; } int main(int argc, char **argv) { int q; cin >> q; ll qs[q]; for (int i = 0; i < q; i++) { cin >> qs[i]; } for (int i = 0; i < q; i++) { ll inth, nth, dec, s, sm, num; dec = decade(qs[i]); s = sums(dec); sm = qs[i] - s; nth = (ll)ceil((double)sm/(double)dec); inth = nth % dec; num = nnum(dec, nth); cout << num/*dig((int)num, inth+1)*/ << endl; } return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
ABABABABABABABABABABABABABABAB... |
user output |
---|
(empty) |
Test 2
Verdict: ACCEPTED
input |
---|
AABBAABBAABBAABBAABBAABBAABBAA... |
correct output |
---|
(empty) |
user output |
---|
(empty) |
Test 3
Verdict: ACCEPTED
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
(empty) |
user output |
---|
(empty) |
Test 4
Verdict: WRONG ANSWER
input |
---|
BBABABBBBBAABBBABABABBBBAAABAB... |
correct output |
---|
BAB |
user output |
---|
(empty) |
Test 5
Verdict: WRONG ANSWER
input |
---|
ACDCBBACDBBBACAACBBDBADBAABABA... |
correct output |
---|
ACDCACDADBADABACACDCADADABABCA... |
user output |
---|
(empty) |
Test 6
Verdict: WRONG ANSWER
input |
---|
EETFHIJOGACDHMGVFJCMETMZDEITTR... |
correct output |
---|
TFHIJOGACDHMGVFJCMETMZDEIROTET... |
user output |
---|
(empty) |
Test 7
Verdict: WRONG ANSWER
input |
---|
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB... |
correct output |
---|
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE... |
user output |
---|
(empty) |
Test 8
Verdict: WRONG ANSWER
input |
---|
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS... |
correct output |
---|
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK... |
user output |
---|
(empty) |
Test 9
Verdict: WRONG ANSWER
input |
---|
QUVVTPXAMWWODFXRONJODPGBTCISGM... |
correct output |
---|
QUTPXAMODFXRONJODPGBTCISGMVRBW... |
user output |
---|
(empty) |
Test 10
Verdict: WRONG ANSWER
input |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
correct output |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
user output |
---|
(empty) |