Submission #00094


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <bits/stdc++.h>
using namespace std;
#define en "\n"
#define re return(0)
#define ima INT_MAX
int main() {
#define int long long
while(1){
int n;
cin>>n;
if(n==0){
re;
}
int count=0;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
for(int i=0;i<n;i++){
count+=a[i];
if(count>300){
count-=a[i];
}
}
cout<<count<<en;
}
re;
}

ステータス

項目 データ
問題 0003 - おやつは300円以内
ユーザー名 SPAAcup(ei2324)
投稿日時 2025-03-28 12:01:39
言語 C++17
状態 Accepted
得点 10
ソースコード長 537 Byte
最大実行時間 22 ms
最大メモリ使用量 544 KB

セット

セット 得点 Cases
1 ALL 10 / 10 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
A1 AC 20 ms 472 KB
1
A2 AC 20 ms 444 KB
1
A3 AC 17 ms 544 KB
1
A4 AC 22 ms 384 KB
1