mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-07 18:06:58 +08:00
Finish: Luogu Beginer Conest(Feb)
This commit is contained in:
37
[语言月赛 202502] 披萨订单.cpp
Normal file
37
[语言月赛 202502] 披萨订单.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
#include <bits/stdc++.h>
|
||||
#define lo long long
|
||||
#define INF INT_MAX
|
||||
#define LLM LONG_LONG_MAX
|
||||
|
||||
using namespace std;
|
||||
const int N = 1e7 + 10;
|
||||
/*
|
||||
toothless. #17
|
||||
@fredcss_dev
|
||||
*/
|
||||
|
||||
signed main() {
|
||||
int X, Y, K;
|
||||
cin >> X >> Y >> K;
|
||||
|
||||
int mx = -1;
|
||||
int count = 0;
|
||||
for (int b = 0; b <= X; ++b) {
|
||||
for (int p = 1; p <= Y; ++p) {
|
||||
for (int z = 0; z <= K; ++z) {
|
||||
int d = (b + p) ^ z;
|
||||
if (d > mx) {
|
||||
mx = d;
|
||||
count = 1;
|
||||
} else if (d == mx) {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cout << mx << endl;
|
||||
cout << count << endl;
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user