Submission #784894

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7848942023-07-16 17:28:59aZvezdaScales (IOI15_scales)C++14
0 / 100
1096 ms38720 KiB
#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#ifndef LOCAL
#define cerr if(false)cerr
#endif
const ll MAX_N = 20;
vector<ll> all;
ll dp[1 << MAX_N];
pair<ll, pair<pair<ll, ll>, pair<ll, ll> > > hist[1 << MAX_N];
bool valid(ll curr, ll a, ll b) {
while(curr % 8 != b) {
if(curr % 8 == a) {
return false;
}
curr /= 8;
}
return true;
}
vector<ll> eliminate(const vector<ll> &curr, ll a, ll b) {
vector<ll> ret = {};
for(const auto it : curr) {
if(valid(it, a, b)) {
ret.push_back(it);
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

scales.cpp: In function 'll encode(const std::vector<long long int>&)':
scales.cpp:46:18: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |  for(ll i = 0; i < arr.size(); i ++) {
      |                ~~^~~~~~~~~~~~
scales.cpp: In function 'void init(int)':
scales.cpp:165:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  165 |  for(int i = 0; i < all.size(); i ++) {
      |                 ~~^~~~~~~~~~~~
scales.cpp:169:23: warning: conversion from 'll' {aka 'long long int'} to 'std::vector<int>::value_type' {aka 'int'} may change value [-Wconversion]
  169 |    ret.push_back(curr % 8);
      |                  ~~~~~^~~
scales.cpp:154:15: warning: unused parameter 'T' [-Wunused-parameter]
  154 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:202:10: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  202 |   W[1] = small;
      |          ^~~~~
scales.cpp:203:10: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  203 |   W[2] = median;
      |          ^~~~~~
scales.cpp:204:10: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  204 |   W[3] = big;
      |          ^~~
scales.cpp:210:10: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  210 |   W[4] = small;
      |          ^~~~~
scales.cpp:211:10: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  211 |   W[5] = median;
      |          ^~~~~~
scales.cpp:212:10: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  212 |   W[6] = big;
      |          ^~~
scales.cpp:215:17: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  215 |   trans[W[i]] = i;
      |                 ^
#Verdict Execution timeMemoryGrader output
Fetching results...