Submission #22645442
Source Code Expand
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std;
void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
∧_∧
∧_∧ (´<_` ) Welcome to My Coding Space!
( ´_ゝ`) / ⌒i @hamayanhamayan0
/ \ | |
/ / ̄ ̄ ̄ ̄/ |
__(__ニつ/ _/ .| .|____
\/____/ (u ⊃
---------------------------------------------------------------------------------------------------*/
int N, K, A[501010];
//---------------------------------------------------------------------------------------------------
void _main() {
cin >> N >> K;
rep(i, 0, N) cin >> A[i];
rep(x, 0, N - K + 1) {
ll ans = 0;
rep(i, 0, K) ans += A[x + i];
printf("%lld\n", ans);
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | D - K Integers Summations |
| User | hamayanhamayan |
| Language | C++ (GCC 9.2.1) |
| Score | 0 |
| Code Size | 1582 Byte |
| Status | TLE |
| Exec Time | 2210 ms |
| Memory | 7552 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 7 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt |
| All | sample_01.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| sample_01.txt | AC | 6 ms | 3692 KiB |
| test_01.txt | AC | 2 ms | 3556 KiB |
| test_02.txt | AC | 2 ms | 3624 KiB |
| test_03.txt | AC | 2 ms | 3748 KiB |
| test_04.txt | AC | 2 ms | 3744 KiB |
| test_05.txt | TLE | 2205 ms | 4564 KiB |
| test_06.txt | TLE | 2205 ms | 5156 KiB |
| test_07.txt | AC | 133 ms | 3700 KiB |
| test_08.txt | TLE | 2205 ms | 5204 KiB |
| test_09.txt | TLE | 2205 ms | 5132 KiB |
| test_10.txt | TLE | 2205 ms | 5116 KiB |
| test_11.txt | TLE | 2205 ms | 4752 KiB |
| test_12.txt | AC | 897 ms | 4036 KiB |
| test_13.txt | TLE | 2210 ms | 7540 KiB |
| test_14.txt | TLE | 2205 ms | 5312 KiB |
| test_15.txt | TLE | 2205 ms | 5312 KiB |
| test_16.txt | TLE | 2205 ms | 5324 KiB |
| test_17.txt | AC | 101 ms | 7552 KiB |
| test_18.txt | AC | 56 ms | 5648 KiB |
| test_19.txt | AC | 52 ms | 5644 KiB |
| test_20.txt | AC | 56 ms | 5400 KiB |