Codeforces 703A Mishka and Game
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <math.h> #include <string> using namespace std; int main() { int n; scanf("%d", &n); int big = 0; int small = 0; int equ = 0; for (int i = 1;i <= n;++i) { int a, b; scanf("%d %d", &a, &b); if (a > b) { big++; } else if (a == b) { equ++; } else { small++; } } if (big > small) { printf("Mishka\n"); } else if (big == small) { printf("Friendship is magic!^^\n"); } else { printf("Chris\n"); } //system("pause"); return 0; }
相關推薦
Codeforces 703A Mishka and Game
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <math.h> #include <string> using namespace s
codeforces 842E. Nikita and game
called you integer cos esc neighbour ecif led inpu Nikita plays a new computer game. There are m levels in this game. In the beginning of
codeforces 703E Mishka and Divisors
gcd 過程 處理 元素 大小 多次 -a 超時 可能 codeforces 703E Mishka and Divisors 題面 給出大小為\(1000\)的數組和一個數\(k\),求長度最短的一個子序列使得子序列的元素之積是\(k\)的倍數,如果有多個解輸出元素和最小
codeforces 703D Mishka and Interesting sum 偶數亦或 離線+前綴樹狀數組
rmi data 一個 day 得到 地方 operator 每一個 思路 題目傳送門 題目大意:給出n個數字,m次區間詢問,每一次區間詢問都是詢問 l 到 r 之間出現次數為偶數的數 的亦或和。 思路:偶數個相同數字亦或得到0,奇數個亦或得到本身,那麽如果把一段區間暴力亦
CodeForces - 816C Karen and Game(簡單模擬)
Problem Description On the way to school, Karen became fixated on the puzzle game on her phone! The game is played as follows. In each level
CodeForces-816C Karen and Game 水題
CodeForces-816C Karen and Game 題意: 給定一個矩陣, 可以把一個全是0的矩陣通過給一行或一列加1到達這個矩形, 問方式(spical judge), 若不能輸出-1. 分析: 純暴力模擬一下, 矩陣的大小不超過100. 程
codeforces D. Mishka and Interesting sum 求區間內不同數的異或值
Little Mishka enjoys programming. Since her birthday has just passed, her friends decided to present her with array of non-negative integersa1, a2, ...,
Codeforces Round #365 (Div. 2) D - Mishka and Interesting sum(離線樹狀數組)
turn string 之前 algorithm printf ace r++ void contest http://codeforces.com/contest/703/problem/D 題意: 給出一行數,有m次查詢,每次查詢輸出區間內出現次數為偶數次的數字的異
【貪心】 Codeforces Round #419 (Div. 1) A. Karen and Game
blog true 刪除 round 貪心 cnblogs pac names namespace 容易發現,刪除的順序不影響答案。 所以可以隨便刪。 如果行數大於列數,就先刪列;否則先刪行。 #include<cstdio> #include<algo
CodeForces 840B - Leha and another game about graph | Codeforces Round #429(Div 1)
scanf 如何 about graph its pri include art int 思路來自這裏,重點大概是想到建樹和無解情況,然後就變成樹形DP了- - /* CodeForces 840B - Leha and another game about gra
Codeforces 841D Leha and another game about graph - 差分
新的 number == 處理 ace ood int 多余 一點 Leha plays a computer game, where is on each level is given a connected graph with n vertices and m e
Codeforces 850C Arpa and a game with Mojtaba
得到 cond get 每次 while %d mem sizeof void 題意:給定一個正整數序列,兩人輪流對這個數列進行如下修改:選取一個素數p和一個整數k將序列中能整除p^k的數除以p^k,問誰有必勝策略。 借此復習一下sg函數吧,sg(x) = mex (
Codeforces 816C/815A - Karen and Game
操作 判斷 spa contest printf define font 技術 大於 傳送門:http://codeforces.com/contest/816/problem/C 本題是一個模擬問題。 有一個n×m的矩陣。最初,這個矩陣為零矩陣O。現有以下操作: a.行
CodeForces-546D Soldier and Number Game 篩法+動態規劃
The ade ems http void string style thead pri 題目鏈接:https://cn.vjudge.net/problem/CodeForces-546D 題意 抱歉,我給忘了,現在看題目又看不懂: P 思路 篩法+dp 話說這個函數應該
Educational Codeforces Round 56 (Rated for Div. 2) C - Mishka and the Last Exam(貪心/差分約束)
題意 給一個n,一個序列b[], bi=ai+a(n+i-1), 求不降序的a序列[] 思路來源 組裡各神犇&&自己 題解 Solution1: 顯然a1=0,an=b1的時候,區間長度最長 區間裡面內建區間的時候如果內區間能左對齊,顯
【Codeforces Round 365 (Div 2)D】【離線詢問 樹狀陣列 前驅思想】Mishka and Interesting sum 區間內出現次數偶數的數的異或和
Little Mishka enjoys programming. Since her birthday has just passed, her friends decided to present her with array of non-negative integersa1, a2, ...,
Karen and Game CodeForces - 816C (暴力+構造)
ems ++ his center bsp uil -i define ldl On the way to school, Karen became fixated on the puzzle game on her phone! The game is played
Codeforces Round #365 (Div. 2) Problem D.Mishka and Interesting sum 解題報告
題目連結:Here! 題目大意:給你n個數,然後m次查詢,每一次查詢輸出所有在給定區間內出現偶數次數的數的異或值,如果只有一個出現偶數次數的數,則直接輸出該數,如果沒有出現偶數次數的數,則輸出0。 解題思路:看到區間查詢,第一反應是線段樹,但是用線段樹來統計區間內出現次數為
codeforces 798C Mike and gcd problem
opera can sample pan using str ssl else font C.Mike and gcd problem Mike has a sequence A?=?[a1,?a2,?...,?an] of length n. He cons
CodeForces 321A Ciel and Robot(數學模擬)
ont amp force 等於 return printf print -- 題意 題目鏈接:http://codeforces.com/problemset/problem/321/A 題意:在一個二維平面中,開始時在(0,0)點,目標點是(a。b),問能不能通過反