小米oj 反向位整数(简单位运算)

- 反向位整数

序号:#30难度:一般时间限制:1000ms内存限制:10M

描述

输入32位无符号整数,输出它的反向位。 例,输入4626149(以二进制表示为00000000010001101001011011100101),返回2808701440(以二进制表示为10100111011010010110001000000000)。

输入

一个无符号32位整数字符串

输出

一个无符号32位整数,为输入整数的反向位

输入样例

4626149

 复制样例

输出样例

2808701440
#include<stdio.h>
using namespace std;
typedef long long ll;
int main()
{ll n;ll m;while(~scanf("%lld",&n)){m=0;for(int i=0;i<32;i++){m|=((1&(n>>i))<<31-i);} printf("%lld\n",m);}return 0;
}

 

转载于:https://www.cnblogs.com/linruier/p/9926031.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/278977.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何在Microsoft Word中插入签名

Adding your signature to a Microsoft Word document is the ultimate way to personalize it as your own, especially for documents like letters or contracts. If you want to add a signature to a Word document, here’s how. 将签名添加到Microsoft Word文档是将其个…

linux 内核fpic,linux编译动态库 fPIC作用

标签&#xff1a;在生成动态库时&#xff0c;常常习惯性的加上fPIC选项&#xff0c;fPIC有什么作用和意义&#xff0c;加不加有什么区别&#xff0c;这里做下小结&#xff1a;fPIC的全称是 Position Independent Code&#xff0c; 用于生成位置无关代码。什么是位置无关代码&am…

jdk 1结尾和2结尾_“与巢一起工作”的结尾对您意味着什么

jdk 1结尾和2结尾korisbo/Shutterstock科里斯博/ ShutterstockGoogle announced the end of “Works With Nest” at Google I/O 2019. Many companies, from IFTTT to Philips Hue, use Works With Nest to automate your smarthome. Those automations will break soon. Goog…

spring-cloud:利用eureka实现服务提供与调用示例

1.运行环境 开发工具&#xff1a;intellij idea JDK版本&#xff1a;1.8 项目管理工具&#xff1a;Maven 4.0.0 2.GITHUB地址 https://github.com/nbfujx/springCloud-learn-demo/tree/master/spring-cloud-eureka-producer-consumer

linux 桌面显示视频播放器,Ubuntu 13.10开启媒体播放器VLC桌面通知的步骤

VLC是一款多功能的媒体播放器&#xff0c;支持众多音频及视频格式&#xff0c;能够适用于Ubuntu等系统&#xff0c;而VLC播放器有桌面通知功能&#xff0c;需要手动开启&#xff0c;下面小编就以Ubuntu 13.10为例&#xff0c;给大家详细介绍下Ubuntu 13.10开启VLC桌面通知的步骤…

独家 | 蚂蚁金服TRaaS技术风险防控平台解密

小蚂蚁说&#xff1a; 在金融行业&#xff0c;风险防控能力的重要性不言而喻。而蚂蚁金服可实现高达99.999%的异地多活容灾&#xff0c;千亿级资金秒级实时核对“账、证、实”等能力也让业界有目共睹。 今年位于杭州的蚂蚁金服ATEC科技大会上&#xff0c;蚂蚁金服正式推出技术风…

谷歌表格_如何使用宏自动执行Google表格

谷歌表格Google Sheets lets you automate repetitive tasks with macros, and you can then bind them to keyboard shortcuts to execute them quickly. They work using Google Apps Script to capture your actions for later use. Google表格可以让您使用宏自动执行重复性…

阿里云弹性高性能计算E-HPC强势来袭,全新打造一站式云超算

为什么80%的码农都做不了架构师&#xff1f;>>> 摘要&#xff1a; 如今&#xff0c;高性能计算已在不知不觉中渗透到人类生活的方方面面。从材料科学到石油勘探、金融市场、应急管理、医学和互联网等领域&#xff0c;高性能计算无一不大显身手&#xff0c;帮助快速…

linux导出硬件信息,Linux 上生成硬件信息与配置报告: Sysreport

当需要 Linux 主机详细完整的描述给另一个人的时候&#xff0c;这个工具非常适合。用 root 用户之行&#xff0c;但要注意最好不要抓取 currently installed packages 信息&#xff0c;这一步非常慢。(用 -norpm 参数)存储厂商 EMC 也有个 EMCgrab 工具&#xff0c;工作原理类似…

深度优先搜索(DFS)----------------Tju_Oj_3517The longest athletic track

这个题主要考察对树的操作&#xff0c;主要思想是DFS或者BFS&#xff0c;其次是找树的直径方法&#xff08;既要运用两次BFS/DFS&#xff09;&#xff0c;最后作为小白&#xff0c;还练习了vector的操作。 DFS框架伪码: bool DSF(Node oneTreePoint ){ //传入的结点和其他有效…

word中图片超出页边距_如何在Word中更改页边距

word中图片超出页边距Word documents open with one-inch margins by default. You can adjust the page margins by choosing one of Word’s predefined options, or you can specify the exact height and width of the margins yourself. Here’s how. 默认情况下&#xff…

Android 中文 API (16) —— AnalogClock

一、结构 public class AnalogClock extends View java.lang.Object android.view.View android.widget.AnalogClock 二、类概述 这是一个带有时针和分针的模拟时钟控件。 三、受保护的方法 protected void onAttachedToWindow () 视图&#xff08;AnalogClock&#xff09;附在…

linux服务器探针软件,服务器安装ServerStatus监控探针教程

前言本文将介绍在服务器上安装ServerStatus来监控多台服务器的运行状态的教程.ServerStatus-Toyo版是一个酷炫高逼格的云探针、云监控、服务器云监控、多服务器探针~&#xff0c;该云监控(云探针)ServerStatus-Toyo项目链接本文为Stille原创文章.经实践,测试,整理发布.如需转载…

iphone播客怎么上传_如何在iPhone,iPad或Android上收听播客

iphone播客怎么上传Khamosh PathakKhamosh PathakDid someone recently recommend you listen to a podcast? If your response was, “What’s a podcast?” we’ve got the answer, and more! Here’s a crash course on podcasts and how you can listen to them on your …

NOIP2018 退役记

NOIP挂完&#xff0c;OI再见 AFO Day 0 早上的高铁&#xff0c;1点多到广州&#xff0c;2点多到酒店&#xff0c;下午就是颓颓颓&#xff0c;然后晚上随便刷了一下板子&#xff0c;反正PJ也没啥板子可以刷 就这样浪费了一天&#xff0c;我到底在干嘛 Day 1 早上心态很好的继续刷…

Linux决心书/李世超

Linux决心书大家好&#xff0c;我叫李世超&#xff0c;来自河北邯郸。今年24&#xff0c;感觉之前的生活状态不是自己想要的&#xff0c;每天浑浑噩噩。我觉得人要对自己定一个目标&#xff0c;我的目标就是月薪10K以上&#xff0c;所以我要努力在老男孩教育学习技术。珍惜这五…

linux下设备或资源忙,linux删除文件目录 目录设备或资源忙怎么办

linux删除文件目录 目录设备或资源忙怎么办来源&#xff1a;未知作者&#xff1a;老黑时间&#xff1a;09-09-21【打印】[rootrs swms]# rmdir zpggrmdir: ‘zpgg’: 设备或资源忙相关服务都已经停止掉了&#xff0c;有什么办法强制删除吗&#xff1f;你可以在有windows的硬盘上…

Codeforces 1066 C(思维)

传送门&#xff1a; 题面&#xff1a; C. Books Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You have got a shelf and want to put some books on it. You are given qq queries of three type…

outlook默认签名设置_如何将默认签名添加到Outlook会议请求

outlook默认签名设置An odd quirk in Outlook is the inability to add a default signature to meeting requests. Here’s a quick and simple way to set up a one-click solution that avoids cutting and pasting every time you create a meeting. Outlook中的一个奇怪问…

技嘉 linux设置u盘启动项,技嘉主板bios设置u盘启动教程

对于想要重装系统的朋友来说&#xff0c;进bios一直是最大的难关&#xff0c;对于技嘉主板来说尤为复杂&#xff0c;下面小编就详细给大家介绍一下技嘉主板bios设置u盘启动的方法。方法一&#xff1a;使用u盘启动快捷键直接进入u盘装系统1、技嘉主板u盘启动快捷键是F12&#xf…