UVA 11078 Open Credit System .
来源:互联网 发布:2016青少年犯罪率数据 编辑:程序博客网 时间:2024/05/16 00:44
题目地址:http://vjudge.net/problem/UVA-11078
#include <bits/stdc++.h>using namespace std;#define REP(i,a,b) for(int i=a;i<=(b);++i)#define REPD(i,a,b) for(int i=a;i>=(b);--i)#define max(a,b) ((a)>(b)?(a):(b))#define min(a,b) ((a)<(b)?(a):(b))int inline readInt(){char ch;bool sign=false;do{ch=getchar();if(ch=='-')sign=true;}while(!isdigit(ch));int x=0;do{x=x*10+ch-'0';ch=getchar();}while(isdigit(ch));return sign?-x:x;}int buf[10];void inline printInt(int n){int p=0;bool sign=n<0;n=sign?-n:n;if(n==0) p++;while(n){buf[p++]=n%10;n/=10;}if(sign) putchar('-');REPD(i,p-1,0) putchar('0'+buf[i]);}const int maxn=100000+5,INF=0x3f3f3f3f;int main(int argc, char const *argv[]){int T; T=readInt();while(T--){int n=readInt();int ans=-INF,Maxi=readInt(),Aj;REP(i,2,n){Aj=readInt();ans=max(ans,Maxi-Aj);Maxi=max(Maxi,Aj);}printInt(ans);putchar('\n');}return 0;}
0 0
- UVA 11078 Open Credit System
- Uva-11078-Open Credit System
- UVA 11078 - Open Credit System
- uva 11078 Open Credit System
- UVa 11078 - Open Credit System
- UVA 11078 Open Credit System
- UVA 11078 Open Credit System
- UVa:11078 Open Credit System
- UVA - 11078 Open Credit System
- Open Credit System UVa 11078
- UVA 11078 Open Credit System
- UVA 11078 - Open Credit System
- uva 11078 Open Credit System
- UVA 11078 Open Credit System
- UVA - 11078 Open Credit System
- UVA 11078 Open Credit System
- UVa 11078 - Open Credit System
- Open Credit System UVA 11078
- 【codevs 1069】关押罪犯
- Activity的四种启动方式
- 【???】【???】了不起的郁杨
- hadoop2.4.1集群安装
- Toolbar在Win SDK下用法
- UVA 11078 Open Credit System .
- Leetcode-105. Construct Binary Tree from Preorder and Inorder Traversal
- .vimrc
- 01-nodejs入门介绍
- Main函数参数argc,argv说明
- android Icon UI
- Mac安装Python MySQLdb
- React Native
- RAC环境下如何利用冷备份进行恢复