Submission #45733

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
457332018-04-16 05:02:09RayaBurong25_1Scales (IOI15_scales)C++17
100 / 100
104 ms892 KiB
#include "scales.h"
#include <vector>
#include <algorithm>
#include <stdio.h>
typedef struct node node;
struct node
{
int q, a, b, c, d;
std::vector<int> V;
node* next[3];
};
node* root;
std::vector<int> Permu[720];
int compare(std::pair<int, int> a, std::pair<int, int> b)
{
return (a.first < b.first);
}
int answer(int P, int q, int a, int b, int c, int d)
{
// printf("answer P%d q%d a%d b%d c%d d%d\n", P, q, a, b, c, d);
int i;
// for (i = 0; i < 6; i++)
// printf("%d ", Permu[P][i]);
// printf("\n");
std::vector<std::pair<int, int> > W;
switch (q)
{
case 1:
W.push_back({Permu[P][a], 0});
W.push_back({Permu[P][b], 1});
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

In file included from grader.c:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (_ghksjhdfkae19ga_ > 1) 
     ^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  for (i = 0; i < 6; i++) {
  ^~~
scales.cpp: In function 'int answer(int, int, int, int, int, int)':
scales.cpp:21:9: warning: unused variable 'i' [-Wunused-variable]
     int i;
         ^
scales.cpp: In function 'int makeTree(node*, int)':
scales.cpp:92:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                             for (v = 0; v < p->V.size(); v++)
                                         ~~^~~~~~~~~~~~~
scales.cpp:95:57: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                                 if (Scratch[v].size()*3 > LIM)
                                     ~~~~~~~~~~~~~~~~~~~~^~~~~
scales.cpp:128:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         for (v = 0; v < p->V.size(); v++)
                                     ~~^~~~~~~~~~~~~
scales.cpp:134:53: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                             if (Scratch[v].size()*3 > LIM)
                                 ~~~~~~~~~~~~~~~~~~~~^~~~~
scales.cpp: In function 'void init(int)':
scales.cpp:191:12: warning: unused variable 'j' [-Wunused-variable]
     int i, j;
            ^
scales.cpp:204:9: warning: unused variable 'ok' [-Wunused-variable]
     int ok = makeTree(root, 729);
         ^~
scales.cpp:189:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
scales.cpp: In function 'int answer(int, int, int, int, int, int)':
scales.cpp:64:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...