Submission #61584837
Source Code Expand
Copy
#include <iostream>using namespace std;inline void givestone(int* A, int giver, int taker) {if (A[giver] > 0){A[giver]--;A[taker]++;}return;}int main() {int N, A[500000];cin >> N;for (int i = 0; i < N; i++){cin >> A[i];}
#include <iostream> using namespace std; inline void givestone(int* A, int giver, int taker) { if (A[giver] > 0) { A[giver]--; A[taker]++; } return; } int main() { int N, A[500000]; cin >> N; for (int i = 0; i < N; i++) { cin >> A[i]; } for (int i = 0; i < N; i++) { for (int j = 0; j < i; j++) { givestone(A, j, i); } } for (int i = 0; i < N - 1; i++) { cout << A[i] << ' '; } cout << A[N - 1] << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Coming of Age Celebration |
User | zetaita |
Language | C++ 17 (Clang 16.0.6) |
Score | 0 |
Code Size | 491 Byte |
Status | TLE |
Exec Time | 2207 ms |
Memory | 5332 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample00.txt, sample01.txt, sample02.txt |
All | sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample00.txt | AC | 1 ms | 3520 KB |
sample01.txt | AC | 1 ms | 3480 KB |
sample02.txt | AC | 1 ms | 3484 KB |
testcase00.txt | AC | 1 ms | 3444 KB |
testcase01.txt | TLE | 2207 ms | 5332 KB |
testcase02.txt | TLE | 2207 ms | 5208 KB |
testcase03.txt | TLE | 2207 ms | 4832 KB |
testcase04.txt | TLE | 2207 ms | 5232 KB |
testcase05.txt | TLE | 2207 ms | 3732 KB |
testcase06.txt | TLE | 2207 ms | 5288 KB |
testcase07.txt | TLE | 2207 ms | 4836 KB |
testcase08.txt | TLE | 2207 ms | 5184 KB |
testcase09.txt | TLE | 2207 ms | 4868 KB |
testcase10.txt | TLE | 2207 ms | 5284 KB |
testcase11.txt | TLE | 2207 ms | 4104 KB |
testcase12.txt | TLE | 2207 ms | 5164 KB |
testcase13.txt | TLE | 2207 ms | 4572 KB |
testcase14.txt | TLE | 2207 ms | 5228 KB |
testcase15.txt | TLE | 2207 ms | 3600 KB |
testcase16.txt | TLE | 2207 ms | 5308 KB |
testcase17.txt | TLE | 2207 ms | 4884 KB |
testcase18.txt | TLE | 2207 ms | 5168 KB |
testcase19.txt | TLE | 2207 ms | 5092 KB |