NYOJ 527 AC_mm dota

Source: Internet
Author: User
Tags dota

NYOJ 527 AC_mm dota

AC_mm dota play time limit: 1000 MS | memory limit: 65535 KB difficulty: 2
Description

As we all know, AC_mm prefers to play games, especially the classic game war3. One day AC_mm came to the vsplatform and was about to abuse cainiao. It happened that we abused our ACM Captain ^_^, and our captain was unhappy, it is said that a difficult problem is required to embarrass AC_mm. This is the description of the question. To give a positive integer n, n has a 1 and B 0 in binary representation (excluding leading 0 and sign bit, evaluate the value ans of the nth * B of the Fibonacci series after the modulo of 1314520.

Note (Fibonacci sequence: f [0] = 1, f [1] = 1; f [n] = f [n-1] + f [N-2]; n> = 2 ;)

Input
Input: there are multiple groups of test data, enter a positive integer n (n <1000000000 );
Output
Output: ans Value
Sample Input
126
Sample output
52

The idea of this question is simple. The key is to take binary, convert, and obtain x * y, and obtain the remainder when the table is typed.

# Include
     
      
Int a [260]; int s [40]; int shift1 (int n) {int num = 1, I; s [0] = n % 2; while (n/2! = 0) {n/= 2; s [num ++] = n % 2;} int t; for (I = 0; I <= num/2; I ++) // here num/2 do not write num {t = s [I]; s [I] = s [num-1-i]; s [num-1-i] = t ;} int x = 0, y = 0; for (I = 0; I
      
       
There must be a problem with the back-end database on NYOJ. You can leave the remainder when you do not create a table !!!

Related Article

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.