Submission #1063484

# Submission time Handle Problem Language Result Execution time Memory
1063484 2024-08-17T19:17:29 Z alexdd Magic Show (APIO24_show) C++17
0 / 100
2 ms 808 KB
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
std::vector<std::pair<int,int>> Alice()
{
    int N = 5000;
    long long k = setN(N);
    vector<pair<int,int>> edges;
    edges.push_back({1,2});
    edges.push_back({1,3});
    for(int i=4;i<=N;i++)
    {
        int b = i%60;
        if(((1LL<<b)&k))
        {
            edges.push_back({2,i});
        }
        else
        {
            edges.push_back({3,i});
        }
    }
    return edges;
}
/**
             1
            / \
           2   3
          /     \
         A       B

A = biti 1
B = biti 0
*/
#include <bits/stdc++.h>
#include "Bob.h"

// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().
using namespace std;
long long Bob(std::vector<std::pair<int,int>> edges)
{
    int N = 5000;
    long long k=0;
    for(auto [x,y]:edges)
    {
        if(x==2)
        {
            k = (k|(1LL<<(y%60)));
        }
    }
    return k;
}

Compilation message

Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:9:9: warning: unused variable 'N' [-Wunused-variable]
    9 |     int N = 5000;
      |         ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 808 KB Correct.
2 Incorrect 1 ms 808 KB Incorrect answer.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 808 KB Correct.
2 Incorrect 1 ms 808 KB Incorrect answer.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 808 KB Correct.
2 Incorrect 1 ms 808 KB Incorrect answer.
3 Halted 0 ms 0 KB -