Submission #61592963
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
#define LL long long
const int N=1e6;
int sj[N];
int main()
{
int n,i,p,s;
scanf("%d",&n);
for (i=0;i<n;i++)
{
scanf("%d",&sj[i]);
}
for (i=0;i<n;i++)
{
s=0;
for (p=0;p<i;p++)
{
if (sj[p]>0)
{
sj[p]--;
s++;
}
}
sj[i]+=s;
}
for (i=0;i<n;i++)
{
if (i)printf(" ");
printf("%d",sj[i]);
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | D - Coming of Age Celebration |
| User | dragon666 |
| Language | C++ 20 (gcc 12.2) |
| Score | 0 |
| Code Size | 419 Byte |
| Status | TLE |
| Exec Time | 2212 ms |
| Memory | 5484 KiB |
Compile Error
Main.cpp: In function ‘int main()’:
Main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
Main.cpp:12:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d",&sj[i]);
| ~~~~~^~~~~~~~~~~~~
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 | 3676 KiB |
| sample01.txt | AC | 1 ms | 3680 KiB |
| sample02.txt | AC | 1 ms | 3924 KiB |
| testcase00.txt | AC | 1 ms | 3900 KiB |
| testcase01.txt | TLE | 2207 ms | 5368 KiB |
| testcase02.txt | TLE | 2207 ms | 5348 KiB |
| testcase03.txt | TLE | 2207 ms | 5060 KiB |
| testcase04.txt | TLE | 2207 ms | 5316 KiB |
| testcase05.txt | TLE | 2207 ms | 3904 KiB |
| testcase06.txt | TLE | 2207 ms | 5360 KiB |
| testcase07.txt | TLE | 2207 ms | 4952 KiB |
| testcase08.txt | TLE | 2207 ms | 5324 KiB |
| testcase09.txt | TLE | 2207 ms | 5156 KiB |
| testcase10.txt | TLE | 2210 ms | 5312 KiB |
| testcase11.txt | TLE | 2207 ms | 4152 KiB |
| testcase12.txt | TLE | 2212 ms | 5484 KiB |
| testcase13.txt | TLE | 2207 ms | 4628 KiB |
| testcase14.txt | TLE | 2207 ms | 5312 KiB |
| testcase15.txt | AC | 1009 ms | 3880 KiB |
| testcase16.txt | TLE | 2207 ms | 5460 KiB |
| testcase17.txt | TLE | 2207 ms | 4996 KiB |
| testcase18.txt | TLE | 2207 ms | 5276 KiB |
| testcase19.txt | TLE | 2207 ms | 5220 KiB |