QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#340010 | #1958. Grid Triangle | ucup-team1209# | WA | 1ms | 3812kb | C++20 | 1.2kb | 2024-02-28 12:05:06 | 2024-02-28 12:05:06 |
Judging History
answer
#include<bits/stdc++.h>
using std::cin;
using std::cout;
using ll = long long;
std::vector<int> vs[] = {
{1, 2, 3},
{1, 3, 2},
{2, 1, 3},
{2, 3, 1},
{3, 1, 2},
{3, 2, 1},
};
std::multiset<int> f(std::vector<int> v) {
std::multiset<int> s;
for(int x : v) s.emplace(std::abs(x));
return s;
}
int A, B, C;
int main() {
std::ios::sync_with_stdio(false), cin.tie(0);
cin >> A >> B >> C;
ll ans = 0;
for(auto x : vs) {
for(int j = 0;j < 8;++j) {
auto t = x;
for(int k = 0;k < 3;++k) if(j >> k & 1) t[k] *= -1;
auto aa = t; sort(aa.begin(), aa.end());
do {
for(int l = 0;l < 8;++l) {
auto a = aa;
for(int k = 0;k < 3;++k) if(l >> k & 1) a[k] *= -1;
auto z = t;
for(int j = 0;j < 3;++j) {
z[j] -= a[j];
}
if(f(t) == f(a) && f(t) == f(z)) {
int min = 1e7;
min = std::min(min, A / std::abs(t[0]));
min = std::min(min, A / std::abs(a[0]));
min = std::min(min, B / std::abs(t[1]));
min = std::min(min, B / std::abs(a[1]));
min = std::min(min, C / std::abs(t[2]));
min = std::min(min, C / std::abs(a[2]));
ans += min;
}
}
} while(next_permutation(aa.begin(), aa.end()));
}
}
cout << ans / 2 << '\n';
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3644kb
input:
1 1 4
output:
0
result:
ok single line: '0'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
1 1 5
output:
0
result:
ok single line: '0'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
1 2 6
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
1 2 7
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
2 2 8
output:
0
result:
ok single line: '0'
Test #6:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
2 3 9
output:
16
result:
ok single line: '16'
Test #7:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
2 3 10
output:
16
result:
ok single line: '16'
Test #8:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
2 3 11
output:
16
result:
ok single line: '16'
Test #9:
score: -100
Wrong Answer
time: 1ms
memory: 3584kb
input:
3 4 12
output:
48
result:
wrong answer 1st lines differ - expected: '64', found: '48'