제출 #1063484

#제출 시각아이디문제언어결과실행 시간메모리
1063484alexdd마술쇼 (APIO24_show)C++17
0 / 100
2 ms808 KiB
#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;
}

컴파일 시 표준 에러 (stderr) 메시지

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...