Submission #00193


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<bits/stdc++.h>
using namespace std;
#define re return(0)
#define en "\n"
int main(){
#define int long long
int n;
cin>>n;
int c=0;
if(n==1){
cout<<1<<en;
re;
}
for(int i=1;i<=n;i++){
if(i%2!=0){
c+=i;
}
}
cout<<c<<en;
re;
}

ステータス

項目 データ
問題 0007 - 偶数嫌いのユタカくん
ユーザー名 SPAAcup(ei2324)
投稿日時 2024-04-26 16:22:50
言語 C++17
状態 Accepted
得点 10
ソースコード長 336 Byte
最大実行時間 29 ms
最大メモリ使用量 648 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in1.txt AC 29 ms 600 KB
1
in2.txt AC 21 ms 444 KB
1
in3.txt AC 18 ms 416 KB
1
in4.txt AC 16 ms 648 KB
1
in5.txt AC 24 ms 492 KB
1
in6.txt AC 14 ms 592 KB
1
insample1.txt AC 21 ms 560 KB
1
insample2.txt AC 18 ms 404 KB
1
insample3.txt AC 21 ms 504 KB
1