QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#681369#5732. Even or OddfazlavarxAC ✓0ms3684kbC++23448b2024-10-27 05:59:512024-10-27 05:59:51

Judging History

你现在查看的是最新测评结果

  • [2024-10-27 05:59:51]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3684kb
  • [2024-10-27 05:59:51]
  • 提交

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;
}

详细

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'