100 Unaccepted求调%%%

B2077 角谷猜想

zhang_hao_yi @ 2024-12-28 22:19:54

Subtask #1 TLE

#include<bits/stdc++.h>

#define This_is_the_main_function main()
#define This_is_the_semicolon ;

#define This_is_the_32_bit_integer_data_type int
#define This_is_the_unsigned_32_bit_integer_data_type unsigned This_is_the_32_bit_integer_data_type
#define This_is_the_64_bit_integer_data_type long long
#define This_is_the_unsigned_64_bit_integer_data_type unsigned This_is_the_64_bit_integer_data_type

#define This_is_the_input cin
#define This_is_the_output cout

#define This_is_the_judgment if
#define This_is_the_otherwise else
#define This_is_the_otherwise_judgment This_is_the_otherwise This_is_the_judgment
#define This_is_the_cycle while

#define This_is_the_newline endl

using namespace std This_is_the_semicolon

This_is_the_32_bit_integer_data_type n This_is_the_semicolon

This_is_the_32_bit_integer_data_type This_is_the_main_function{

    This_is_the_input>>n This_is_the_semicolon

    This_is_the_cycle(n!=1){
        This_is_the_judgment(n%2==0){
            This_is_the_output<<n<<"/2="<<n/2<<This_is_the_newline This_is_the_semicolon
            n/=2 This_is_the_semicolon
        }This_is_the_otherwise{
            This_is_the_output<<n<<"*3+1="<<n*3+1<<This_is_the_newline This_is_the_semicolon
            n=n*3+1 This_is_the_semicolon
        }
    }

    This_is_the_output<<"End";

    return 0 This_is_the_semicolon
}

更适合中国(English)宝宝的代码 :D :D :D


by zhang_hao_yi @ 2024-12-28 22:23:32

我纸不过是

d

e

f

i

n

e

大佬吗...


by linch @ 2024-12-28 22:28:42

@zhang_hao_yi 同学你好,我非常感谢你的宏定义,希望你在赛场上能保持这样的码风。

请注意变量 n 需要开 long long,也就是 This_is_the_64_bit_integer_data_type


by linch @ 2024-12-28 22:29:40

这个宏定义让我一看就头大。


by LionBlaze @ 2024-12-28 22:30:54

@zhang_hao_yi 让我想起了中级语言的代码。


by keep_eating @ 2024-12-28 22:34:48

有看你代码的时间,我代码都写好了

代码

自己看吧。


by zhang_hao_yi @ 2024-12-29 19:05:09

@linch蟹蟹awa


by zhang_hao_yi @ 2024-12-29 19:09:48

改过了(我只不是随随便便发了一篇文章罢了) 代码


|