Wrong Answer
Code
#include <iostream>
using namespace std;
int main() {
// SAYED AL MAMUN_LU
int t;
cin >> t;
while (t--) {
int n, sum = 0;
cin >> n;
int yy = (n - 1);
while (yy > 0) {
sum = sum + yy;
yy--;
}
int result = sum;
int team = n / 2;
if (team > 1) {
int yy2 = (team - 1);
while (yy2 > 0) {
result = result + yy2;
yy2--;
}
}
else {
result = result + 1;
}
if(n == 1){
cout<<0<<endl;
}
else {
cout<<result<<endl;
}
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1026 LUFA cup 2024
- Contest
- Brain booster #2
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-03-06 14:31:19
- Judged At
- 2024-11-11 03:41:54
- Judged By
- Score
- 10
- Total Time
- 17ms
- Peak Memory
- 544.0 KiB