QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#719674 | #3597. Some Sum | andahe | AC ✓ | 0ms | 3704kb | C++20 | 803b | 2024-11-07 07:47:41 | 2024-11-07 07:47:42 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define LL __int128_t
#define PB push_back
#define MK make_pair
#define fi first
#define se second
#define FOR(i, x, y) for (decay<decltype(y)>::type i = (x), _##i = (y); i <= _##i; ++i)
#define FORD(i, x, y) for (decay<decltype(x)>::type i = (x), _##i = (y); i >= _##i; --i)
#define debug(x) cout<< "\033 -> "<<#x<<": "<<x<<endl
using namespace std;
int main()
{
//freopen("1.in","r",stdin);
ios::sync_with_stdio(false);
cin.tie(NULL);
int n; cin >> n;
int flag = 2;
for(int i = 1; i <= 100-n+1; ++i)
{
int sum = 0;
FOR(j, 1, n) sum += i+j-1;
if(flag == 2) flag = sum%2;
else if(flag != sum%2) {cout<<"Either"<<endl; return 0;}
}
if(flag == 1) cout<<"Odd"<<endl;
else cout<<"Even"<<endl;
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3628kb
input:
1
output:
Either
result:
ok single line: 'Either'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
2
output:
Odd
result:
ok single line: 'Odd'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
3
output:
Either
result:
ok single line: 'Either'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
4
output:
Even
result:
ok single line: 'Even'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
5
output:
Either
result:
ok single line: 'Either'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
6
output:
Odd
result:
ok single line: 'Odd'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
7
output:
Either
result:
ok single line: 'Either'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3704kb
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: 3552kb
input:
10
output:
Odd
result:
ok single line: 'Odd'