Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <set>
- #include <map>
- #include <algorithm>
- #include <cmath>
- #include <string>
- using namespace std;
- typedef long long ll;
- int dp[301][301][301];
- int arr[3];
- int main() {
- int m;
- cin >> m;
- for (int i=0; i<m; i++){
- cin >> arr[i];
- }
- for (int i=0; i<301; i++){
- for (int j=0; j<301; j++){
- for (int k=0; k<301; k++){
- if (dp[i][j][k] == 1)
- continue;
- for (int n=1; n<301; n++){
- if (i+n < 301) dp[i+n][j][k] = 1;
- if (j+n < 301) dp[i][j+n][k] = 1;
- if (k+n < 301) dp[i][j][k+n] = 1;
- if (m == 2) {
- if (max(i,j)+n < 301) dp[i+n][j+n][k] = 1;
- }
- if (max(i, max(j, k))+n < 301) dp[i+n][j+n][k+n] = 1;
- }
- }
- }
- }
- if (dp[ arr[0] ][ arr[1] ][ arr[2] ]) cout << "BitLGM";
- else cout << "BitAryo";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement