Codeforces Round #169 (Div. 2)---C. Little Girl and Maximum Sum(簡單貪心), The little girl loves the problems on array queries very much.One day she came across a rather well-known problem: you’ve got an array of n elements (the elements of the
LeetCode,leetcodeoj題目連結:Remove Duplicates from Sorted ListGiven a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.
最小產生樹,產生樹最小產生樹 一個有 n 個結點的連通圖的最小產生樹是原圖的極小連通子圖,且包含原圖中的所有 n 個結點,並且有保持圖連通的權值總和最小的邊。劉汝佳<<訓練指南>>P343詳細介紹了最小產生樹相關的知識。 下面直接給出Kruskal演算法的模板:<span style="font-size:18px;">
Python入門——石頭剪刀布程式,python入門石頭剪刀概述:如果你和我一樣是一個有著其他語言基礎的編程者,那我想這個小程式對於你來說是小case。由於本人初學Python,就先拿這個熟悉熟悉一下文法,就不再是以前大家都愛用的Hello World了。流程圖:代碼如下:import random# define a function for get winner# 1: Scissor# 2: Stone# 3: Clothdef get_winner(you, me): if
NSDictionary,NSArray轉成NSData(JSON)NSString類型,nsdatansstring//// NSDictionary+JSONorNSString.h// UIKit資料轉換//// Created by mac on 15-4-4.// Copyright (c) 2015年 www.swift.com. All rights reserved.//#import <Foundation/Foundation.h>@interface