Codeforces 458A Golden System

Source: Internet
Author: User

After calculating the size comparison of two strings the main q^2=q+1 is obviously Fibonacci number

100,000-bit definitely super ll I'm in each of the only two to be within the AC

#include <bits/stdc++.h>using namespace Std;int a[100020];char s1[100020],s2[100020];int main () {scanf ("%s%s",    S1,S2);    int Len1=strlen (S1), Len2=strlen (S2);    for (int i=len1-1;i>=0;i--) {if (s1[i]== ' 1 ') a[len1-i-1]++;    } for (int i=len2-1;i>=0;i--) {if (s2[i]== ' 1 ') a[len2-i-1]--;            } for (int i=100000;i>=2;i--) {if (a[i]==1) {a[i-1]++;        a[i-2]++;            } else if (a[i]>=2) {a[i-1]+=2;        a[i-2]+=2;            } else if (a[i]==-1) {a[i-1]--;        a[i-2]--;            } else if (a[i]<=-2) {a[i-1]-=2;        a[i-2]-=2;    } a[i]=0;    } Double x= (sqrt (5) +1)/2;    if (a[1]*x+a[0]>0) printf (">\n");    else if (a[1]*x+a[0]<0) printf ("<\n");    else printf ("=\n"); return 0;}


Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

Codeforces 458A Golden System

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.