Task: | Merkkijono |
Sender: | 367535629127093 |
Submission time: | 2017-10-10 16:26:06 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | TIME LIMIT EXCEEDED | 0 |
test | verdict | time | |
---|---|---|---|
#1 | TIME LIMIT EXCEEDED | -- | details |
#2 | TIME LIMIT EXCEEDED | -- | details |
#3 | TIME LIMIT EXCEEDED | -- | details |
#4 | TIME LIMIT EXCEEDED | -- | details |
#5 | TIME LIMIT EXCEEDED | -- | details |
#6 | TIME LIMIT EXCEEDED | -- | details |
#7 | TIME LIMIT EXCEEDED | -- | details |
#8 | TIME LIMIT EXCEEDED | -- | details |
#9 | TIME LIMIT EXCEEDED | -- | details |
#10 | TIME LIMIT EXCEEDED | -- | details |
Code
#include <bits/stdc++.h> using namespace std; int n; inline int subsqcnt(unsigned int asd) { if(asd==0) return 1; else if(asd==1) return 2; else return subsqcnt(asd-2) + subsqcnt(asd-1) + 1; } inline int uniqsubBIT(bitset<32> bs, int length) { bs = bs.flip(); int yk = 1; int nl = 0; int count = 2; int prev; for(int i=length-2; i>=0; i--) { prev = count; count *= 2; if(bs[i]==false) { count -= nl; nl = prev; } else { count -= yk; yk = prev; } } return count; } int main() { cin >> n; int bp = 1; for(int i=0; i<n; i++) { bp = i; if(subsqcnt(i)-1>=n) break; } einain: int ff = pow(2, bp)/2; for(int i=0; i<ff; i++) { if(i%32==0&&__builtin_popcount(i)==1&&i>2){ se: int fhj = i; int huhu=1; while(fhj>=2) { fhj/=2; huhu++; } int verytemp =(4*pow(2,huhu)-3-(-pow(-1,huhu)))/6+1; bitset<32> bst(verytemp); if(uniqsubBIT(bst, bp)-1<n) { i = pow(2, huhu); continue; } } bitset<32> bs(i); int nnnnnn = uniqsubBIT(bs, bp); if(nnnnnn-1 == n) { cout << bs.to_string().substr(32-bp); return 0; } if(nnnnnn*2<n) { /// ei kai toimi i++; if(i%32==0&&__builtin_popcount(i)==1&&i>2) goto se; } } bp++; goto einain; }
Test details
Test 1
Verdict: TIME LIMIT EXCEEDED
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
ABABABABABABABABABABABABABABAB... |
user output |
---|
(empty) |
Test 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
AABBAABBAABBAABBAABBAABBAABBAA... |
correct output |
---|
(empty) |
user output |
---|
(empty) |
Test 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
(empty) |
user output |
---|
(empty) |
Test 4
Verdict: TIME LIMIT EXCEEDED
input |
---|
BBABABBBBBAABBBABABABBBBAAABAB... |
correct output |
---|
BAB |
user output |
---|
(empty) |
Test 5
Verdict: TIME LIMIT EXCEEDED
input |
---|
ACDCBBACDBBBACAACBBDBADBAABABA... |
correct output |
---|
ACDCACDADBADABACACDCADADABABCA... |
user output |
---|
(empty) |
Test 6
Verdict: TIME LIMIT EXCEEDED
input |
---|
EETFHIJOGACDHMGVFJCMETMZDEITTR... |
correct output |
---|
TFHIJOGACDHMGVFJCMETMZDEIROTET... |
user output |
---|
(empty) |
Test 7
Verdict: TIME LIMIT EXCEEDED
input |
---|
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB... |
correct output |
---|
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE... |
user output |
---|
(empty) |
Test 8
Verdict: TIME LIMIT EXCEEDED
input |
---|
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS... |
correct output |
---|
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK... |
user output |
---|
(empty) |
Test 9
Verdict: TIME LIMIT EXCEEDED
input |
---|
QUVVTPXAMWWODFXRONJODPGBTCISGM... |
correct output |
---|
QUTPXAMODFXRONJODPGBTCISGMVRBW... |
user output |
---|
(empty) |
Test 10
Verdict: TIME LIMIT EXCEEDED
input |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
correct output |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
user output |
---|
(empty) |