Accepted
Code
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long T, N;
scanf("%lld", &T);
while(T--){
scanf("%lld", &N);
long long res, mod, noOfOdds;
if(N%2==1){
noOfOdds = (N/2) + (N%2);
} else {
noOfOdds = N/2;
}
printf("%lld\n", noOfOdds);
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1041 Odd number
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-03-31 08:04:36
- Judged At
- 2024-11-11 03:36:30
- Judged By
- Score
- 100
- Total Time
- 2ms
- Peak Memory
- 540.0 KiB