Submission #286480

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2864802020-08-30 13:08:13AaronNaiduScales (IOI15_scales)C++14
71.43 / 100
54 ms512 KiB
#include <bits/stdc++.h>
#include "scales.h"
using namespace std;
int t;
vector<vector<int> > possiblePerms;
bool used[7];
void init(int T) {
t = T;
}
int vectorFind(vector<int> v, int a) {
for (int i = 0; i < v.size(); i++)
{
if (v[i] == a)
{
return i;
}
}
return -1;
}
void generatePerms(vector<int> v) {
if (v.size() == 6)
{
possiblePerms.push_back(v);
return;
}
for (int i = 1; i <= 6; i++)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

scales.cpp: In function 'int vectorFind(std::vector<int>, int)':
scales.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 < v.size(); i++)
      |                     ~~^~~~~~~~~~
scales.cpp: In function 'int checkOther(int, int, int, int)':
scales.cpp:117:20: warning: unused parameter 'a' [-Wunused-parameter]
  117 | int checkOther(int a, int b, int c, int d) {
      |                ~~~~^
scales.cpp:117:27: warning: unused parameter 'b' [-Wunused-parameter]
  117 | int checkOther(int a, int b, int c, int d) {
      |                       ~~~~^
scales.cpp:117:34: warning: unused parameter 'c' [-Wunused-parameter]
  117 | int checkOther(int a, int b, int c, int d) {
      |                              ~~~~^
scales.cpp:117:41: warning: unused parameter 'd' [-Wunused-parameter]
  117 | int checkOther(int a, int b, int c, int d) {
      |                                     ~~~~^
scales.cpp: In function 'void optimalQuestion()':
scales.cpp:124:27: warning: variable 'mind' set but not used [-Wunused-but-set-variable]
  124 |     int mina, minb, minc, mind;
      |                           ^~~~
scales.cpp:16:9: warning: 'minc' may be used uninitialized in this function [-Wmaybe-uninitialized]
   16 |         if (v[i] == a)
      |         ^~
scales.cpp:124:21: note: 'minc' was declared here
  124 |     int mina, minb, minc, mind;
      |                     ^~~~
scales.cpp:16:9: warning: 'minb' may be used uninitialized in this function [-Wmaybe-uninitialized]
   16 |         if (v[i] == a)
      |         ^~
scales.cpp:124:15: note: 'minb' was declared here
  124 |     int mina, minb, minc, mind;
      |               ^~~~
scales.cpp:16:9: warning: 'mina' may be used uninitialized in this function [-Wmaybe-uninitialized]
   16 |         if (v[i] == a)
      |         ^~
scales.cpp:124:9: note: 'mina' was declared here
  124 |     int mina, minb, minc, mind;
      |         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...