Codeforces723 A. The New Year: Meeting Friends (水题)
来源:互联网 发布:淘宝手机端套餐设置 编辑:程序博客网 时间:2024/05/16 06:42
题目连接:http://codeforces.com/contest/723/problem/A
解题思路:水水水水水。
/* ***********************************************┆ ┏┓ ┏┓ ┆┆┏┛┻━━━┛┻┓ ┆┆┃ ┃ ┆┆┃ ━ ┃ ┆┆┃ ┳┛ ┗┳ ┃ ┆┆┃ ┃ ┆┆┃ ┻ ┃ ┆┆┗━┓ 马 ┏━┛ ┆┆ ┃ 勒 ┃ ┆ ┆ ┃ 戈 ┗━━━┓ ┆┆ ┃ 壁 ┣┓┆┆ ┃ 的草泥马 ┏┛┆┆ ┗┓┓┏━┳┓┏┛ ┆┆ ┃┫┫ ┃┫┫ ┆┆ ┗┻┛ ┗┻┛ ┆************************************************ */#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <stack>#include <set>#include <map>#include <string>#include <math.h>#include <stdlib.h>#include <bitset>using namespace std;#define rep(i,a,b) for (int i=(a),_ed=(b);i<=_ed;i++)#define per(i,a,b) for (int i=(b),_ed=(a);i>=_ed;i--)#define pb push_back#define mp make_pairconst int inf_int = 2e9;const long long inf_ll = 2e18;#define inf_add 0x3f3f3f3f#define mod 1000000007#define LL long long#define ULL unsigned long long#define MS0(X) memset((X), 0, sizeof((X)))#define SelfType intSelfType Gcd(SelfType p,SelfType q){return q==0?p:Gcd(q,p%q);}SelfType Pow(SelfType p,SelfType q){SelfType ans=1;while(q){if(q&1)ans=ans*p;p=p*p;q>>=1;}return ans;}#define Sd(X) int (X); scanf("%d", &X)#define Sdd(X, Y) int X, Y; scanf("%d%d", &X, &Y)#define Sddd(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)#define reunique(v) v.resize(std::unique(v.begin(), v.end()) - v.begin())#define all(a) a.begin(), a.end()#define mem(x,v) memset(x,v,sizeof(x))typedef pair<int, int> pii;typedef pair<long long, long long> pll;typedef vector<int> vi;typedef vector<long long> vll;inline int read(){int ra,fh;char rx;rx=getchar(),ra=0,fh=1;while((rx<'0'||rx>'9')&&rx!='-')rx=getchar();if(rx=='-')fh=-1,rx=getchar();while(rx>='0'&&rx<='9')ra*=10,ra+=rx-48,rx=getchar();return ra*fh;}//#pragma comment(linker, "/STACK:102400000,102400000")int main(){//freopen("in.txt","r",stdin);//freopen("out.txt","w",stdout);ios::sync_with_stdio(0);cin.tie(0);Sddd(a,b,c);int mx = max(a,max(b,c));int mi = min(a,min(b,c));int ans = inf_add;for(int i=mi;i<=mx;i++) { int res = abs(a-i) + abs(b-i) + abs(c-i); ans = min(ans,res); } printf("%d\n",ans);return 0;}
0 0
- Codeforces723 A. The New Year: Meeting Friends (水题)
- A. The New Year: Meeting Friends
- [codeforces]A. The New Year: Meeting Friends 水题
- CodeForces 723A-The New Year: Meeting Friends(很水)
- Codeforces Round #375 (Div. 2)A. The New Year: Meeting Friends(水题)
- Codeforces 723A The New Year: Meeting Friends
- 【69.77%】【codeforces 723A】The New Year: Meeting Friends
- Codeforces — 723A. The New Year: Meeting Friends
- The New Year: Meeting Friends Codeforces Round#375-A
- Codeforce 723A - The New Year: Meeting Friends
- Codeforces 723A-The New Year: Meeting Friends
- 【Codeforces Round 375 (Div 2) A】【水题】The New Year Meeting Friends
- Codeforces 723A The New Year: Meeting Friends(题意有偏差的水题)
- Codeforces The New Year: Meeting Friends
- codeforces723AThe New Year: Meeting Friends+水题
- Codeforces Round #375 (Div. 2) A-The New Year: Meeting Friends
- codeforces——723A—— The New Year: Meeting Friends
- CodeForces 723A he New Year: Meeting Friends
- gps坐标离线转百度坐标
- 大学文化对当代大学生的影响
- mvc构建开发twig模板引擎
- noip2012 Vigenère密码
- html的表格设定
- Codeforces723 A. The New Year: Meeting Friends (水题)
- 概率(多边形,uva 11971)
- 机器人概率定位学习笔记第四篇_使用python进行机器人概率定位
- 14 idea 配置, 部署eclipse web项目
- STL学习笔记(一)
- noip2012同余方程
- 【神经网络与深度学习】【C/C++】ZLIB学习
- codeforces723BText Document Analysis+水题
- Codeforces723 B. Text Document Analysis (模拟/水)