Submission #2876499
Source Code Expand
Copy
#include <bits/stdc++.h>using namespace std;int a, b, c, x, y, z;int main() {int i, ans;cin >> a >> b >> c;x = abs(a - b);y = abs(b - c);z = abs(a - c);i = max(x, max(y, z));if(i == x)ans = y + z;else if(i == y)ans = z + x;elseans = y + x;cout << ans << endl;return 0;}
#include <bits/stdc++.h> using namespace std; int a, b, c, x, y, z; int main() { int i, ans; cin >> a >> b >> c; x = abs(a - b); y = abs(b - c); z = abs(a - c); i = max(x, max(y, z)); if(i == x) ans = y + z; else if(i == y) ans = z + x; else ans = y + x; cout << ans << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Task Scheduling Problem |
User | m_tsubasa |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 343 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01, sample_02, sample_03 |
All | 0_small_rand_0, 0_small_rand_1, 0_small_rand_2, 0_small_rand_3, 1_rand_0, 1_rand_1, 1_rand_2, 1_rand_3, 2_hand_0, 2_hand_1, sample_01, sample_02, sample_03 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_small_rand_0 | AC | 1 ms | 256 KB |
0_small_rand_1 | AC | 1 ms | 256 KB |
0_small_rand_2 | AC | 1 ms | 256 KB |
0_small_rand_3 | AC | 1 ms | 256 KB |
1_rand_0 | AC | 1 ms | 256 KB |
1_rand_1 | AC | 1 ms | 256 KB |
1_rand_2 | AC | 1 ms | 256 KB |
1_rand_3 | AC | 1 ms | 256 KB |
2_hand_0 | AC | 1 ms | 256 KB |
2_hand_1 | AC | 1 ms | 256 KB |
sample_01 | AC | 1 ms | 256 KB |
sample_02 | AC | 1 ms | 256 KB |
sample_03 | AC | 1 ms | 256 KB |