QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#681369 | #5732. Even or Odd | fazlavarx | AC ✓ | 0ms | 3684kb | C++23 | 448b | 2024-10-27 05:59:51 | 2024-10-27 05:59:51 |
Judging History
answer
#include <iostream>
using namespace std;
int main()
{
int N;
cin >> N;
int sum = 0;
for(int i = 1; i <= N; i++)
{
sum += i;
}
if(sum % 2 == 0)
{
if(N % 2 == 0)
cout << "Even\n";
else
cout << "Either\n";
}
else{
if(N % 2 == 0)
cout << "Odd\n";
else
cout << "Either\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3636kb
input:
1
output:
Either
result:
ok single line: 'Either'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
2
output:
Odd
result:
ok single line: 'Odd'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
3
output:
Either
result:
ok single line: 'Either'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
4
output:
Even
result:
ok single line: 'Even'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
5
output:
Either
result:
ok single line: 'Either'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
6
output:
Odd
result:
ok single line: 'Odd'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
7
output:
Either
result:
ok single line: 'Either'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3684kb
input:
8
output:
Even
result:
ok single line: 'Even'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
9
output:
Either
result:
ok single line: 'Either'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
10
output:
Odd
result:
ok single line: 'Odd'