Submission #219453

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2194532020-04-05 10:49:31IgorIMechanical Doll (IOI18_doll)C++17
53 / 100
175 ms15360 KiB
#include <doll.h>
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
/*void answer(vector<int> c, vector<int> x, vector<int> y)
{
//cout << "final : " << c.size() << " " << x.size() << " " << y.size() << endl;
for (int i = 0; i < c.size(); i++) cout << c[i] << "\n";
for (int i = 0; i < x.size(); i++) cout << x[i] << " " << y[i] << "\n";
exit(0);
}*/
const int INF = 1e9;
vector<int> c, x, y;
vector<int> bitreverse(int k)
{
vector<int> c;
for (int i = 0; i < (1 << k); i++)
{
int y = 0;
for (int j = 0; j < k; j++)
{
y = 2 * y + (((1 << j) & i) > 0);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

doll.cpp: In function 'void build(int, std::vector<int>)':
doll.cpp:48:22: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   48 |         if (v.size() <= (1 << i))
      |             ~~~~~~~~~^~~~~~~~~~~
doll.cpp:51:32: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   51 |             while (tree.size() < (1 << i))
      |                    ~~~~~~~~~~~~^~~~~~~~~~
doll.cpp:57:32: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   57 |             while (tree.size() < 2 * (1 << i))
      |                    ~~~~~~~~~~~~^~~~~~~~~~~~~~
doll.cpp:74:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   74 |             for (int j = 0; j < out.size(); j++)
      |                             ~~^~~~~~~~~~~~
doll.cpp:83:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   83 |             for (int i = 1; 2 * i + 1 < tree.size(); i++)
      |                             ~~~~~~~~~~^~~~~~~~~~~~~
doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:99:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   99 |     for (int i = 0; i + 1 < a.size(); i++)
      |                     ~~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...