QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#739996 | #8993. Menger Sponge | ucup-team004 | AC ✓ | 1ms | 3716kb | C++23 | 824b | 2024-11-13 00:14:11 | 2024-11-13 00:14:14 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
using u128 = unsigned __int128;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int L;
std::cin >> L;
int u[3], v[3];
for (int i = 0; i < 3; i++) {
std::cin >> u[i] >> v[i];
}
for (int t = 0; t < L; t++) {
int a[3];
for (int i = 0; i < 3; i++) {
u[i] *= 3;
a[i] = u[i] / v[i];
u[i] %= v[i];
}
int c = 0;
for (int i = 0; i < 3; i++) {
c += (a[i] == 1 && u[i] != 0);
}
if (c >= 2) {
std::cout << "0\n";
return 0;
}
}
std::cout << "1\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3652kb
input:
0 1 1000000 1 1000000 1 1000000
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
1000 1 3 1 3 1 3
output:
1
result:
ok single line: '1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
2 49 81 5 6 20 81
output:
1
result:
ok single line: '1'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
3 49 81 5 6 20 81
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
0 1 2 1 2 1 2
output:
1
result:
ok single line: '1'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
1 1 2 1 2 1 2
output:
0
result:
ok single line: '0'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
109 1 177146 1 59048 1 3
output:
1
result:
ok single line: '1'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
110 1 177146 1 59048 2 3
output:
0
result:
ok single line: '0'
Test #9:
score: 0
Accepted
time: 1ms
memory: 3680kb
input:
100000 5 26 15 26 5 7
output:
1
result:
ok single line: '1'
Test #10:
score: 0
Accepted
time: 1ms
memory: 3632kb
input:
100000 695 59049 505 2187 2182 2187
output:
1
result:
ok single line: '1'
Test #11:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
100000 174368 177147 505 2187 39782 177147
output:
1
result:
ok single line: '1'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
100000 82085 177147 44923 177147 45418 177147
output:
0
result:
ok single line: '0'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
100000 153353 177147 150301 177147 5966 6561
output:
0
result:
ok single line: '0'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
100000 33478 37669 594397 623816 222031 380163
output:
0
result:
ok single line: '0'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
12 33478 37669 594397 623816 222031 380163
output:
1
result:
ok single line: '1'
Test #16:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
100000 1 795704 1 797161 1 177148
output:
1
result:
ok single line: '1'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
100000 510118 958261 72899 310918 580609 776150
output:
0
result:
ok single line: '0'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
14 510118 958261 72899 310918 580609 776150
output:
1
result:
ok single line: '1'
Test #19:
score: 0
Accepted
time: 1ms
memory: 3716kb
input:
100000 1 2 3 4 1 4
output:
1
result:
ok single line: '1'