QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#466524#8508. DiviDueloSwarthmore#WA 4ms3820kbC++142.3kb2024-07-07 21:46:302024-07-07 21:46:31

Judging History

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

  • [2024-07-07 21:46:31]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:3820kb
  • [2024-07-07 21:46:30]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define FOR(i, a, b) for (int i = 0; i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i+++)
#define FORd(i, a, b) for (int i = (b) - 1; i >= (a); i--)
#define F0Rd(i, a) for (int i = (a) - 1; i >= 0; i--)
#define trav(a, x) for (auto &a : x)
#define sz(x) (int)(x).size()
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define in insert

const char nl = '\n';

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << x;}
void __print(const char *x) {cerr << x;}
void __print(const string &x) {cerr << x;}
void __print(bool x) {cerr << (x ? "true" : "false"); }

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << "< "; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? ", " : ""), __print(i); cerr << "}";}

void __print() {cerr << "]\n";}
template<typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}

#ifdef DEBUG
#define dbg(x...) cerr << "\e[91m"<<__func__<<":"<<__LINE__<<" [" << #x << "] = [":; _print(x); cerr << "\e39m" << endl;
#else
#define dbg(x...)
#endif

void solve() {

}


int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	ll N; cin >> N;
	ll X = N;
	map<ll, int> mp;
	for (ll i = 2; i*i <= N; i++) {
		while (X % i == 0) {
			mp[i]++;
			X /= i;
		}
	}
	if (X > 1) mp[X]++;

	bool poss = false;
	if (sz(mp) == 2) poss = true;
	if (sz(mp) == 1 && mp.begin()->second % 2 == 1) poss = true;

	cout << (poss ? 'Y' : 'N') << '\n';
	return 0;
}





Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

10

output:

Y

result:

ok "Y"

Test #2:

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

input:

9

output:

N

result:

ok "N"

Test #3:

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

input:

1

output:

N

result:

ok "N"

Test #4:

score: 0
Accepted
time: 3ms
memory: 3740kb

input:

549755813888

output:

Y

result:

ok "Y"

Test #5:

score: 0
Accepted
time: 2ms
memory: 3524kb

input:

274877906944

output:

N

result:

ok "N"

Test #6:

score: 0
Accepted
time: 3ms
memory: 3524kb

input:

847288609443

output:

Y

result:

ok "Y"

Test #7:

score: 0
Accepted
time: 2ms
memory: 3528kb

input:

282429536481

output:

N

result:

ok "N"

Test #8:

score: 0
Accepted
time: 2ms
memory: 3520kb

input:

137858491849

output:

N

result:

ok "N"

Test #9:

score: 0
Accepted
time: 1ms
memory: 3604kb

input:

10604499373

output:

Y

result:

ok "Y"

Test #10:

score: 0
Accepted
time: 2ms
memory: 3544kb

input:

506623120463

output:

Y

result:

ok "Y"

Test #11:

score: 0
Accepted
time: 1ms
memory: 3772kb

input:

10779215329

output:

N

result:

ok "N"

Test #12:

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

input:

41910794561

output:

Y

result:

ok "Y"

Test #13:

score: 0
Accepted
time: 1ms
memory: 3524kb

input:

64574155417

output:

Y

result:

ok "Y"

Test #14:

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

input:

75644818241

output:

Y

result:

ok "Y"

Test #15:

score: 0
Accepted
time: 1ms
memory: 3544kb

input:

124029899611

output:

Y

result:

ok "Y"

Test #16:

score: 0
Accepted
time: 1ms
memory: 3604kb

input:

134306640043

output:

Y

result:

ok "Y"

Test #17:

score: 0
Accepted
time: 1ms
memory: 3776kb

input:

146462570411

output:

Y

result:

ok "Y"

Test #18:

score: 0
Accepted
time: 2ms
memory: 3524kb

input:

222287988673

output:

Y

result:

ok "Y"

Test #19:

score: 0
Accepted
time: 2ms
memory: 3552kb

input:

263345887171

output:

Y

result:

ok "Y"

Test #20:

score: 0
Accepted
time: 3ms
memory: 3476kb

input:

717451682557

output:

Y

result:

ok "Y"

Test #21:

score: 0
Accepted
time: 3ms
memory: 3544kb

input:

825365364157

output:

Y

result:

ok "Y"

Test #22:

score: 0
Accepted
time: 3ms
memory: 3548kb

input:

870298842859

output:

Y

result:

ok "Y"

Test #23:

score: 0
Accepted
time: 3ms
memory: 3472kb

input:

887915259331

output:

Y

result:

ok "Y"

Test #24:

score: 0
Accepted
time: 3ms
memory: 3548kb

input:

967108197509

output:

Y

result:

ok "Y"

Test #25:

score: 0
Accepted
time: 3ms
memory: 3524kb

input:

990661375799

output:

Y

result:

ok "Y"

Test #26:

score: 0
Accepted
time: 3ms
memory: 3508kb

input:

999999999989

output:

Y

result:

ok "Y"

Test #27:

score: 0
Accepted
time: 3ms
memory: 3540kb

input:

999962000357

output:

Y

result:

ok "Y"

Test #28:

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

input:

999474022513

output:

Y

result:

ok "Y"

Test #29:

score: 0
Accepted
time: 4ms
memory: 3808kb

input:

999052035451

output:

Y

result:

ok "Y"

Test #30:

score: 0
Accepted
time: 3ms
memory: 3540kb

input:

999470040641

output:

Y

result:

ok "Y"

Test #31:

score: 0
Accepted
time: 3ms
memory: 3804kb

input:

998712349711

output:

Y

result:

ok "Y"

Test #32:

score: 0
Accepted
time: 3ms
memory: 3596kb

input:

998768376647

output:

Y

result:

ok "Y"

Test #33:

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

input:

998884311283

output:

Y

result:

ok "Y"

Test #34:

score: 0
Accepted
time: 3ms
memory: 3584kb

input:

998794254709

output:

Y

result:

ok "Y"

Test #35:

score: 0
Accepted
time: 3ms
memory: 3520kb

input:

998830303021

output:

Y

result:

ok "Y"

Test #36:

score: 0
Accepted
time: 3ms
memory: 3524kb

input:

999638023157

output:

Y

result:

ok "Y"

Test #37:

score: 0
Accepted
time: 3ms
memory: 3544kb

input:

998978227997

output:

Y

result:

ok "Y"

Test #38:

score: 0
Accepted
time: 3ms
memory: 3588kb

input:

999108034891

output:

Y

result:

ok "Y"

Test #39:

score: 0
Accepted
time: 3ms
memory: 3820kb

input:

998922289621

output:

Y

result:

ok "Y"

Test #40:

score: 0
Accepted
time: 3ms
memory: 3472kb

input:

999172169371

output:

Y

result:

ok "Y"

Test #41:

score: 0
Accepted
time: 3ms
memory: 3808kb

input:

999218015981

output:

Y

result:

ok "Y"

Test #42:

score: -100
Wrong Answer
time: 3ms
memory: 3604kb

input:

981700934653

output:

Y

result:

wrong answer 1st words differ - expected: 'N', found: 'Y'