Submission #1341117
Source Code Expand
#define _CRT_SECURE_NO_DEPRECATE #pragma comment(linker, "/STACK:102400000,102400000") #include<iostream> #include<cstdio> #include<fstream> #include<iomanip> #include<algorithm> #include<cmath> #include<deque> #include<vector> #include<assert.h> #include<bitset> #include<queue> #include<string> #include<cstring> #include<map> #include<stack> #include<set> #include<functional> #define pii pair<int, int> #define mod 1000000007 #define mp make_pair #define pi acos(-1) #define eps 0.00000001 #define mst(a,i) memset(a,i,sizeof(a)) #define all(n) n.begin(),n.end() #define lson(x) ((x<<1)) #define rson(x) ((x<<1)|1) #define inf 0x3f3f3f3f typedef long long ll; typedef unsigned long long ull; using namespace std; const int maxn = 1e4 + 5; int a[maxn]; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int i, j, k, m, n, T; cin >> n; for (int i = 1; i <= n; ++i) cin >> a[i]; sort(a + 1, a + 1 + n); cout << a[n] - a[1] << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Traveling AtCoDeer Problem |
User | Meternal |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1042 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt |
All | in1.txt, in2.txt, in3.txt, in4.txt, s1.txt, s2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in1.txt | AC | 1 ms | 256 KB |
in2.txt | AC | 1 ms | 256 KB |
in3.txt | AC | 2 ms | 256 KB |
in4.txt | AC | 1 ms | 256 KB |
s1.txt | AC | 1 ms | 256 KB |
s2.txt | AC | 1 ms | 256 KB |