QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#797707#3597. Some SumLaVuna47#AC ✓0ms3756kbC++201.7kb2024-12-03 16:57:272024-12-03 16:57:32

Judging History

This is the latest submission verdict.

  • [2024-12-03 16:57:32]
  • Judged
  • Verdict: AC
  • Time: 0ms
  • Memory: 3756kb
  • [2024-12-03 16:57:27]
  • Submitted

answer

/** gnu specific **/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
/** contains everything I need in std **/
#include <bits/stdc++.h>

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(S) ((int)S.size())
#define FOR(i, st_, n) for(int i = st_; i < n; ++i)
#define RFOR(i, n, end_) for(int i = (n)-1; i >= end_; --i)
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef unsigned long long ull;
typedef long double LD;
typedef pair<ull, ull> pull;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
using namespace std;
#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif


int par(int n,int beg)
{
	int ans = 0;
	FOR(i,beg,beg+n)
	{
		ans += i;
	}
	return ans % 2;
}

int solve()
{
	int n;
	if(!(cin>>n))return 1;
	int par1 = par(n,1);
	int par2 = par(n,2);
	if(par1 != par2)
		cout << "Either\n";
	else if(par1 == 0)
		cout << "Even\n";
	else
		cout << "Odd\n";
    return 0;
}

int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int TET = 1e9;
    //cin >> TET;
    for (int i = 1; i <= TET; i++)
    {
        if (solve())
        {
            break;
        }
#ifdef ONPC
        cout << "__________________________" << endl;
#endif
    }
#ifdef ONPC
    cerr << endl << "finished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec" << endl;
#endif
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3660kb

input:

1

output:

Either

result:

ok single line: 'Either'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

2

output:

Odd

result:

ok single line: 'Odd'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

3

output:

Either

result:

ok single line: 'Either'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

4

output:

Even

result:

ok single line: 'Even'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3676kb

input:

5

output:

Either

result:

ok single line: 'Either'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

6

output:

Odd

result:

ok single line: 'Odd'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3744kb

input:

7

output:

Either

result:

ok single line: 'Either'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3676kb

input:

8

output:

Even

result:

ok single line: 'Even'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3672kb

input:

9

output:

Either

result:

ok single line: 'Either'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

10

output:

Odd

result:

ok single line: 'Odd'