Submission #00320


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include<bits/stdc++.h>
using namespace std;
using ll = long long ;
int main(){
int n;
cin>>n;
int ans=0;
for(int i=1;i<=n;i++){
if(i%2==1){
ans+=i;
}
}
cout<<ans<<endl;
}

ステータス

項目 データ
問題 0007 - 偶数嫌いのユタカくん
ユーザー名 r2207
投稿日時 2024-04-26 17:01:35
言語 C++17
状態 Accepted
得点 10
ソースコード長 231 Byte
最大実行時間 31 ms
最大メモリ使用量 632 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in1.txt AC 31 ms 604 KB
1
in2.txt AC 14 ms 580 KB
1
in3.txt AC 19 ms 552 KB
1
in4.txt AC 25 ms 524 KB
1
in5.txt AC 21 ms 500 KB
1
in6.txt AC 28 ms 600 KB
1
insample1.txt AC 16 ms 568 KB
1
insample2.txt AC 29 ms 540 KB
1
insample3.txt AC 25 ms 632 KB
1