AIZU 0005】的更多相关文章

GCD and LCM Time Limit : 1 sec, Memory Limit : 65536 KB Japanese version is here GCD and LCM Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given a and b (0 < a, b ≤ 2,000,000,000). You can sup…
GCD and LCM Descriptions: Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given a and b. Input Input consists of several data sets. Each data set contains a and b separated by a single space in…
第 0005 题:你有一个目录,装了很多照片,把它们的尺寸变成都不大于 iPhone5 分辨率的大小. 首先,iphone5的分辨率是1136x640. if条件句判断横(纵)向是否大于对应的iphone5像素数,若是再减少像素. code: from PIL import Image import glob, os def resize(): for files in glob.glob('*.jpg'): filepath,filename = os.path.split(files) #分…
第 0005 题:你有一个目录,装了很多照片,把它们的尺寸变成都不大于 iPhone5 分辨率的大小. 本题用了几个os模块的命令, import os from PIL import Image pathDir = r'D:\素材' os.chdir(pathDir) #修改当前工作目录 def modify_imgsize(): for filename in get_imglist(): img = Image.open(filename) if max(img.size) > 1136:…
Aizu 0525 Osenbei https://vjudge.net/problem/Aizu-0525 题目: IOI製菓では,創業以来の伝統の製法で煎餅(せんべい)を焼いている.この伝統の製法は,炭火で一定時間表側を焼き,表側が焼けると裏返して,炭火で一定時間裏側を焼くというものである.この伝統を守りつつ,煎餅を機械で焼いている.この機械は縦 R (1 ≤ R ≤ 10) 行, 横 C (1 ≤ C ≤ 10000) 列の長方形状に煎餅を並べて焼く.通常は自動運転で,表側が焼けたら一斉に…
UVA 1394 And Then There Was One / Gym 101415A And Then There Was One / UVAlive 3882 And Then There Was One / POJ 3517 And Then There Was One / Aizu 1275 And Then There Was One (动态规划,思维题) Description Let's play a stone removing game. Initially, n ston…
Swift教程_swift常见问题(0001)_CoreData: warning: Unable to load class named 'xxx' for entity 'xxx' Swift教程_swift常见问题(0002)_完美处理SourceKitService Crashed异常.6.1.1大部分已经修复 Swift教程_swift常见问题(0003)_storyboard改动不生效 Swift教程_swift常见问题(0004)_swift代码不能自己主动提示和补全 Swift教…
Aizu 2249 & cf 449B 1.Aizu - 2249 选的边肯定是最短路上的. 如果一个点有多个入度,取价值最小的. #include<bits/stdc++.h> using namespace std; #define fi first #define se second #define mp make_pair #define pb push_back #define rep(i, a, b) for(int i=(a); i<(b); i++) #defin…
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_3_B For a given array a1,a2,a3,...,aNa1,a2,a3,...,aN of NN elements and an integer KK, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains…
Aizu - 2564 Tree Reconstruction 题意:一个有向图,要使得能确定每一条边的权值,要求是每个点的入权和出权相等,问你最少需要确定多少条边 思路:这题好像有一个定理之类的,对于每一个连通块,所需要的边数是 M-N(边数-点数) ,这个原理我还不是很清楚. 知道了这个之后,并查集求一下就完事了. 这题我大致看了一下官方 的提交记录,发现有好多种方法可以搞.23:48:40 #pragma comment(linker, "/STACK:1000000000")…