Shanghai Youth Algorithm March 2023 Monthly Competition (Group C)

Shanghai Youth Algorithm March 2023 Monthly Competition (Group C)
T1 Magical Letter Sequence
Title Description
Given a cyclic sequence consisting of three letters "L", "C", and "R": "LCRLCRLCRLC⋯", this The loop section of the sequence is "LCR".
Now given a number n, ask which letter the nth bit of this sequence is.
Input format
Single integer: represents n.
Output format
Single character: represents the nth letter of the sequence of letters.
Data range
For 50% of the data, 1≤n≤1,000,000
For 100% of the data, 1≤n≤1,000,000,000
Sample data
Input:
5
Output:
C

//样例代码
#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
    cin>>n;
    n%=3;
    if(n==0) cout<<"R";
    else if(n==1) cout<<"L";
    else cout<<"C";
    return 0;
}

Classification of T2 divisors
Title description
The ancient Greek mathematician Nicomachus (Nicomachus) divided integers into three categories according to the relationship between the sum of the true factors of the integer and the size of the number:
when the sum of all the true factors of the integer is greater than When it is itself, the number is said to be an excess number (Abundant).
When the sum of all the real factors of this integer is less than itself, the number is said to be an insufficient number (De

Guess you like

Origin blog.csdn.net/lybc2019/article/details/131394085