Submission #1213106
Source Code Expand
#include <iostream> using namespace std; int n, k; long long a[15], ans = 0; int main(){ cin >> n >> k; for (int i = 0; i < n; i++){ cin >> a[i]; } if (n == k){ for (int i = 1; i < n; i++){ if (a[i - 1] >= a[i]){ ans += a[i - 1] - a[i] + 1; a[i] = a[i - 1] + 1; } } } else{ } cout << ans << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Buildings are Colorful! |
User | OIO2012F |
Language | C++14 (GCC 5.4.1) |
Score | 120 |
Code Size | 372 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | Subtask1 | Subtask2 | Subtask3 | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 120 / 120 | 0 / 90 | 0 / 140 | ||||||||||||||
Status |
|
|
|
|
Set Name | Test Cases |
---|---|
Sample | sub0_in1.txt, sub0_in2.txt |
Subtask1 | sub1_in1.txt, sub1_in2.txt |
Subtask2 | sub2_in1.txt, sub2_in2.txt, sub2_in3.txt |
Subtask3 | sub0_in1.txt, sub0_in2.txt, sub1_in1.txt, sub1_in2.txt, sub2_in1.txt, sub2_in2.txt, sub2_in3.txt, sub3_in1.txt, sub3_in2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sub0_in1.txt | AC | 1 ms | 256 KB |
sub0_in2.txt | WA | 1 ms | 256 KB |
sub1_in1.txt | AC | 1 ms | 256 KB |
sub1_in2.txt | AC | 1 ms | 256 KB |
sub2_in1.txt | AC | 1 ms | 256 KB |
sub2_in2.txt | WA | 1 ms | 256 KB |
sub2_in3.txt | WA | 1 ms | 256 KB |
sub3_in1.txt | WA | 1 ms | 256 KB |
sub3_in2.txt | WA | 1 ms | 256 KB |