Submission #36954411
Source Code Expand
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y);
#define chmin(x,y) x = min(x,y);
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const double PI = acos(-1);
int main() {
int n;
cin >> n;
vector<ll> s(n), a(n);
rep(i,n) cin >> s[i];
a[0] = s[0];
for (int i = 1; i < n; i++) {
a[i] = s[i] - s[i-1];
}
rep(i,n) {
cout << a[i] << " ";
}
cout << endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Inverse Prefix Sum |
| User | taki0711 |
| Language | C++ (GCC 9.2.1) |
| Score | 200 |
| Code Size | 708 Byte |
| Status | AC |
| Exec Time | 7 ms |
| Memory | 3628 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt |
| All | min.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| min.txt | AC | 7 ms | 3620 KiB |
| random_01.txt | AC | 2 ms | 3548 KiB |
| random_02.txt | AC | 2 ms | 3524 KiB |
| random_03.txt | AC | 2 ms | 3524 KiB |
| random_04.txt | AC | 2 ms | 3624 KiB |
| random_05.txt | AC | 2 ms | 3448 KiB |
| random_06.txt | AC | 2 ms | 3476 KiB |
| random_07.txt | AC | 2 ms | 3560 KiB |
| random_08.txt | AC | 2 ms | 3628 KiB |
| random_09.txt | AC | 2 ms | 3572 KiB |
| random_10.txt | AC | 3 ms | 3520 KiB |
| sample_01.txt | AC | 2 ms | 3436 KiB |
| sample_02.txt | AC | 2 ms | 3436 KiB |