답안 #875850

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
875850 2023-11-20T15:57:09 Z danikoynov Broken Device 2 (JOI22_device2) C++17
0 / 100
28 ms 1788 KB
#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

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 ++)
      |                     ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 792 KB Output is correct
2 Incorrect 10 ms 1088 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 792 KB Output is correct
2 Incorrect 10 ms 1088 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 792 KB Output is correct
2 Incorrect 10 ms 1088 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 792 KB Output is correct
2 Incorrect 10 ms 1088 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 792 KB Output is correct
2 Incorrect 10 ms 1088 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 28 ms 1788 KB Output isn't correct
2 Halted 0 ms 0 KB -