QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#783191 | #6262. Jazz it Up! | 353cerega# | AC ✓ | 0ms | 3712kb | C++14 | 993b | 2024-11-26 01:04:15 | 2024-11-26 01:04:15 |
Judging History
answer
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define X first
#define Y second
const ll mod = 1000000007;
//const ll mod = 998244353;
ll pew(ll a, ll b) {
ll res = 1;
while (b>0) {
if (b&1) res = res*a%mod;
b >>= 1;
a = a*a%mod;
}
return res;
}
void solve() {
ll n;
cin >> n;
for (ll i=2;i<=10000;i++) {
ll ok = 1;
for (ll j=2;j*j<=i;j++) {
if (i%j==0) {
ok = 0;
break;
}
}
if (ok==0) continue;
if (n%i==0) continue;
cout << i << "\n";
return;
}
}
int main() {
ios_base::sync_with_stdio(false);
int T = 1;
//cin >> T;
while (T--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3640kb
input:
3
output:
2
result:
ok correct
Test #2:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
30
output:
7
result:
ok correct
Test #3:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
13
output:
2
result:
ok correct
Test #4:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
11
output:
2
result:
ok correct
Test #5:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
13
output:
2
result:
ok correct
Test #6:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
14
output:
3
result:
ok correct
Test #7:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
3
output:
2
result:
ok correct
Test #8:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
30030
output:
17
result:
ok correct
Test #9:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
5
output:
2
result:
ok correct
Test #10:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
6
output:
5
result:
ok correct
Test #11:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
7
output:
2
result:
ok correct
Test #12:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
8633
output:
2
result:
ok correct
Test #13:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
89
output:
2
result:
ok correct
Test #14:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
9026
output:
3
result:
ok correct
Test #15:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
9217
output:
2
result:
ok correct
Test #16:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
9410
output:
3
result:
ok correct
Test #17:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
9605
output:
2
result:
ok correct
Test #18:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
99929
output:
2
result:
ok correct
Test #19:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
99961
output:
2
result:
ok correct
Test #20:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
99971
output:
2
result:
ok correct
Test #21:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
99989
output:
2
result:
ok correct
Test #22:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
99991
output:
2
result:
ok correct
Test #23:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
96331
output:
2
result:
ok correct
Test #24:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
24213
output:
2
result:
ok correct
Test #25:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
52259
output:
2
result:
ok correct
Test #26:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
99123
output:
2
result:
ok correct
Test #27:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
43498
output:
3
result:
ok correct
Test #28:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
97589
output:
2
result:
ok correct
Test #29:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
30030
output:
17
result:
ok correct
Test #30:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
11663
output:
2
result:
ok correct
Test #31:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
14351
output:
2
result:
ok correct
Test #32:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
17947
output:
2
result:
ok correct
Test #33:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
20711
output:
2
result:
ok correct
Test #34:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
23707
output:
2
result:
ok correct
Test #35:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
27221
output:
2
result:
ok correct
Test #36:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
30967
output:
2
result:
ok correct
Test #37:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
34571
output:
2
result:
ok correct
Test #38:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
38021
output:
2
result:
ok correct
Test #39:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
199
output:
2
result:
ok correct
Test #40:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
7429
output:
2
result:
ok correct
Test #41:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
33263
output:
2
result:
ok correct
Test #42:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
82861
output:
2
result:
ok correct
Test #43:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
3127
output:
2
result:
ok correct
Test #44:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
4087
output:
2
result:
ok correct
Test #45:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
5183
output:
2
result:
ok correct
Test #46:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
6557
output:
2
result:
ok correct
Test #47:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
8633
output:
2
result:
ok correct
Test #48:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
10403
output:
2
result:
ok correct
Test #49:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
85263
output:
2
result:
ok correct
Test #50:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
84101
output:
2
result:
ok correct