noip2011——普及組——數字反轉
傻逼題,不講了。
#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int t=1,num=0;char c=getchar(); inline int read(){ while(c>‘9‘||c<‘0‘){if(c==‘-‘)t=-1;c=getchar();} while(c>=‘0‘&&c<=‘9‘){num=num*10+c-‘0‘;c=getchar();}return num; } int main() { int a=read(),b=0; while(a){ b=b*10+(a%10); a/=10; } printf("%d",b*t); return 0; }
本文由Yzyet編寫,網址為www.cnblogs.com/Yzyet。非Yzyet同意,禁止轉載,侵權者必究。
noip2011——普及組——數字反轉
相關推薦
noip2011——普及組——數字反轉
har iostream ret name getc lin int com () 傻逼題,不講了。 #include<iostream> #include<cstdio> #include<algorithm> #include<
數字反轉(NOIP2011 普及組第一題)
clas 常見 給定 Language 提示 -h numbers 得到 輸出 描述 給定一個整數,請將該數各個位上數字反轉得到一個新數。新數也應滿足整數的常見形式,即除非給定的原數為零,否則反轉後得到的新數的最高位數字不應為零(參見樣例2)。 格式 輸入格式 輸入共1 行
瑞士輪(NOIP2011 普及組第三題)
輸入 編號 -h 羽毛球 關心 noip2011 number 一個 之前 背景 在雙人對決的競技性比賽,如乒乓球、羽毛球、國際象棋中,最常見的賽制是淘汰賽和循環賽。前者的特點是比賽場數少,每場都緊張刺激,但偶然性較高。後者的特點是較為公平,偶然性較低,但比賽過程往往十分冗
表達式的值(NOIP2011 普及組第四題)
兩種 可能 完成 表示 請問 字符 syn http 數字0 描述 對於 1 位二進制變量定義兩種運算:運算的優先級是:1. 先計算括號內的,再計算括號外的。2. “×”運算優先於“⊕”運算,即計算表達式時,先計算×運算,再計算⊕運算。 例如:計算表達式A⊕B × C 時,
1400統計單詞數 (noip2011普及組第2題)
統計單詞 etl space name main turn cin iostream pre 1 #include<cstdio> 2 #include<cstring> 3 #include<iostream> 4 #incl
【NOIP2011普及組T4】表示式的值-模擬+棧
測試地址:表示式的值 做法:一般求表示式值的問題都用棧來解決,而這一題棧中的每一個元素要存兩個數,可以用pair來儲存,first表示一段中結果為0的情況數,second表示一段中結果為1的情況數。設
題解 NOIP2011 普及組 統計單詞數
題目地址:https://www.luogu.org/problemnew/show/P1308分析:始終感覺這題有毒,因為官方提供的第一組資料,跑起來和我的結果不同,但是我卻AC了(實際上我認為它提供下載的資料是有問題的),另外我一直覺得那個題解部分的最高票答案有問題。。其
[NOIP2010] (普及組) 數字統計
NOIP2010 數字統計 時間限制: 1 Sec 記憶體限制: 128 MB 題目描述 請統計某個給定範圍[L, R]的所有整數中,數字 2 出現的次數。 比如給定範圍[2, 22],數字 2 在數2中出現了 1次,在數 12中出現 1 次,在數
NOIP2011普及組第3題 瑞士輪
題目描述 2*N名編號為1~2N的選手共進行R輪比賽。每輪比賽開始前,以及所有比賽結束後,都會按照總分從高到低對選手進行一次排名。選手的總分為第一輪開始前的初始分數加上已參加過的所有比賽的得分和。總分相同的,約定編號較小的選手排名靠前。 每輪比賽的對陣安排與該輪比賽開始前
[Wikioi 1025][NOIP 2003普及組]數字遊戲
題目描述 Description 丁丁最近沉迷於一個數字遊戲之中。這個遊戲看似簡單,但丁丁在研究了許多天之後卻發覺原來在簡單的規則下想要贏得這個遊戲並不那麼容易。遊戲是這樣的,在你面前有一圈整數(一共n個),你要按順序將其分為m個部分,各部分內的數字相加,相加所得的
[NOIP 2011普及組 No.1] 數字反轉
rev 數字 reverse enter 得到 text eve 輸入輸出 center [NOIP 2011普及組 No.1] 數字反轉 【問題描述】 給定一個整數,請將該數各個位上數字反轉得到一個新數。新數也應滿足整數的常見形式,即除非給定的原數為零,否則反轉後得到
洛谷 P1982 小朋友的數字(NOIp2013普及組T3)
文件 ret vijos 觀察 個數 color 符號 朋友 麻煩 題目描述 有 n 個小朋友排成一列。每個小朋友手上都有一個數字,這個數字可正可負。規定每個小朋友的特征值等於排在他前面(包括他本人)的小朋友中連續若幹個(最少有一個)小朋友手上的數字之和的最大值。 作為這些
【動態規劃】Vijos P1218 數字遊戲(NOIP2003普及組)
題目連結: 題目大意: 一個N個數的環,分成M塊,塊內的數求和%10,最後每塊地值累乘,求最大和最小。 n(1≤n≤50)和m(1≤m≤9)太小了可以隨便搞。 題目思路: 【動態規劃】 區間DP。環形DP。斷環為鏈,在後面補一段N,當鏈做。
NOIP2011提高組 選擇客棧
can 答案 iyu 顏色 兩個 嘗試 文件名 line eight 原題 題目描述 麗江河邊有n 家很有特色的客棧,客棧按照其位置順序從 1 到n 編號。每家客棧都按照某一種色調進行裝飾(總共 k 種,用整數 0 ~ k-1 表示),且每家客棧都設有一家咖啡店,每家咖啡
codevs 1014 裝箱問題 2001年NOIP全國聯賽普及組
bold 位數組 時有 n) 當前 一位數 數組 是否 一位 題目描述 Description 有一個箱子容量為V(正整數,0<=V<=20000),同時有n個物品(0<n<=30),每個物品有一個體積(正整數)。 要求n個物品中,任取若幹個裝入箱內,使箱子的剩
noip2011——提高組——觀光公交
get std printf getchar() include 提高 -- name 公交 這題主要思想就是貪心了。 每次找出最優加速點,更新時間,就可以了。 #include<iostream> #include<cstdio> #includ
全排列(洛谷1061 Jam的計數法or NOIP 2006 普及組 第三題)
div 順序 pre highlight 格式 其中 字符 是個 true Jam是個喜歡標新立異的科學怪人。他不使用阿拉伯數字計數,而是使用小寫英文字母計數,他覺得這樣做,會使世界更加豐富多彩。 在他的計數法中,每個數字的位數都是相同的(使用相同個數的字母),英文字母按
博弈論(noip普及組2010第四題 三國遊戲)
三國 勝利 沒有 blog hang max efi () turn 小涵很喜歡電腦遊戲,這些天他正在玩一個叫做《三國》的遊戲。 在遊戲中,小涵和計算機各執一方,組建各自的軍隊進行對戰。遊戲中共有 N 位武將(N為偶數且不小於 4),任意兩個武將之間有一個“默
二分查找前綴和(洛谷1314聰明的質監員NOIP2011提高組)
ron min 最小值 一個數 -s 判斷 inf bre sync 小T 是一名質量監督員,最近負責檢驗一批礦產的質量。這批礦產共有 n 個礦石,從 1到n 逐一編號,每個礦石都有自己的重量 wi 以及價值vi 。檢驗礦產的流程是: 1 、給定m 個區間[Li,Ri
【noip 2016】普及組
scrip one clu sel b+ -s 位置 ref print T1.買鉛筆 題目鏈接 1 #include<cstdio> 2 #include<algorithm> 3 #include<cstring> 4