Problem 2921 --3.4.3 Electric Fence

2921: 3.4.3 Electric Fence

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $5$ 正确数量 $1$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 usaco

In this problem, `lattice points' in the plane are points with integer coordinates.

In order to contain his cows, Farmer John constructs a triangular electric fence by stringing a "hot" wire from the origin (0,0) to a lattice point [n,m] (0<=;n<32000, 0<m<32000), then to a lattice point on the positive x axis [p,0] (p>0), and then back to the origin (0,0).

A cow can be placed at each lattice point within the fence without touching the fence (very thin cows). Cows can not be placed on lattice points that the fence touches. How many cows can a given fence hold?


The single input line contains three space-separated integers that denote n, m, and p.


A single line with a single integer that represents the number of cows the specified fence can hold.


7 5 10
20

推荐代码 查看2921 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] 梦尘 695300 2020-12-30 23:55:49
内存最少[$1712 $KB] 梦尘 695300 2020-12-30 23:55:49
第一AC 梦尘 695300 2020-12-30 23:55:49
第一挑战 淡意的温柔 596635 2020-06-12 17:16:00

赛题来源/所属竞赛 usaco training usaco Training

竞赛编号 竞赛名称 竞赛时间 访问比赛