This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Anna.h"
#include <utility>
#include <vector>
#include<bits/stdc++.h>
using namespace std;
int Declare()
{
return 140;
}
std::pair<std::vector<int>, std::vector<int> > Anna(long long A)
{
vector < int > x, y;
while(A > 0)
x.push_back(A % 2), A /= 2;
y = x;
return make_pair(x, y);
}
#include "Bruno.h"
#include <utility>
#include <vector>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2010;
int used[2 * maxn];
long long Bruno(std::vector<int> u)
{
vector < ll > x;
memset(used, 0, sizeof(used));
for (int i = 0; i < u.size(); i ++)
{
if (!used[i])
{
x.push_back(u[i]);
int pt = i + 1;
while(u[pt] != u[i])
pt ++;
used[pt] = 1;
}
}
ll ans = 0;
reverse(x.begin(), x.end());
for (int i = 0; i < x.size(); i ++)
ans = ans * 2 + x[i];
///cout << "ans " << ans << endl;
return ans;
}
Compilation message (stderr)
Bruno.cpp: In function 'long long int Bruno(std::vector<int>)':
Bruno.cpp:14:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
14 | for (int i = 0; i < u.size(); i ++)
| ~~^~~~~~~~~~
Bruno.cpp:27:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
27 | for (int i = 0; i < x.size(); i ++)
| ~~^~~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |