XOR和
比赛主页
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
一个函数
,现在牛牛给你一个数
,求
的值是多少。
示例1
输入
复制
4
4
返回值
复制
12
12
备注:
XOR和
返回全部题目
列表加载中...
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param n int整型 * @return long长整型 */ public long Sum (int n) { // write code here } }
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param n int整型 * @return long长整型 */ long long Sum(int n) { // write code here } };
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # @param n int整型 # @return long长整型 # class Solution: def Sum(self , n ): # write code here
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param n int整型 * @return long长整型 */ function Sum( n ) { // write code here } module.exports = { Sum : Sum };
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # @param n int整型 # @return long长整型 # class Solution: def Sum(self , n ): # write code here
package main /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param n int整型 * @return long长整型 */ func Sum( n int ) int64 { // write code here }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param n int整型 * @return long长整型 */ long long Sum(int n ) { // write code here }
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # @param n int整型 # @return long长整型 # class Solution def Sum(n) # write code here end end
4
12