Submission #72994

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
729942018-08-27 12:25:27edisonhelloScales (IOI15_scales)C++14
100 / 100
893 ms892 KiB
#include<bits/stdc++.h>
using namespace std;
#ifndef WEAK
#include"scales.h"
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type"
int coins[6],pos[6],qtime;
int Init(){ return 1; }
void orderCoins(){
cout<<"orderCoins: "<<endl;
for(int i=0;i<6;++i)cin>>coins[i],pos[coins[i]]=i;
}
void answer(int *a){
cout<<"answer: ";
for(int i=0;i<6;++i)cout<<a[i]<<" "; cout<<endl;
cout<<"Query "<<qtime<<" times"<<endl;
}
int getHeaviest(int i,int j,int k){
++qtime;
cout<<"getHeaviest "<<i<<" "<<j<<" "<<k<<endl;
if(pos[i]>pos[j] && pos[i]>pos[k])return i;
if(pos[j]>pos[i] && pos[j]>pos[k])return j;
if(pos[k]>pos[i] && pos[k]>pos[j])return k;
}
int getLightest(int i,int j,int k){
++qtime;
cout<<"getLightest "<<i<<" "<<j<<" "<<k<<endl;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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 lambda function:
scales.cpp:92:17: warning: declaration of 'int i' shadows a parameter [-Wshadow]
         for(int i=0;i<3;++i)if(pp[i].second==l)return pp[i+1].second;
                 ^
scales.cpp:88:45: note: shadowed declaration is here
     auto _sim_getNextLightest=[&](const int i,const int j,const int k,const int l){
                                             ^
scales.cpp: In function 'int go(std::vector<std::vector<int> >&, bool)':
scales.cpp:99:54: warning: conversion to 'int' from 'std::vector<std::vector<int> >::size_type {aka long unsigned int}' may alter its value [-Wconversion]
                 int r1=0,r2=0,r3=0,lim=(now.size()+2)/3;
                                        ~~~~~~~~~~~~~~^~
scales.cpp:101:29: warning: declaration of 'i' shadows a previous local [-Wshadow]
                     for(int i=0;i<6;++i)pos[v[i]]=i;
                             ^
scales.cpp:96:13: note: shadowed declaration is here
     for(int i=1;i<=4;++i){
             ^
scales.cpp:111:33: warning: declaration of 'i' shadows a previous local [-Wshadow]
                         for(int i=0;i<6;++i)pos[v[i]]=i;
                                 ^
scales.cpp:96:13: note: shadowed declaration is here
     for(int i=1;i<=4;++i){
             ^
scales.cpp:123:37: warning: declaration of 'i' shadows a previous local [-Wshadow]
                             for(int i=0;i<6;++i)pos[v[i]]=i;
                                     ^
scales.cpp:96:13: note: shadowed declaration is here
     for(int i=1;i<=4;++i){
             ^
scales.cpp:134:29: warning: declaration of 'i' shadows a previous local [-Wshadow]
                     for(int i=0;i<6;++i)pos[v[i]]=i;
                             ^
scales.cpp:96:13: note: shadowed declaration is here
     for(int i=1;i<=4;++i){
             ^
scales.cpp:144:33: warning: declaration of 'i' shadows a previous local [-Wshadow]
                         for(int i=0;i<6;++i)pos[v[i]]=i;
                                 ^
scales.cpp:96:13: note: shadowed declaration is here
     for(int i=1;i<=4;++i){
             ^
scales.cpp:156:37: warning: declaration of 'i' shadows a previous local [-Wshadow]
                             for(int i=0;i<6;++i)pos[v[i]]=i;
                                     ^
scales.cpp:96:13: note: shadowed declaration is here
     for(int i=1;i<=4;++i){
             ^
scales.cpp:167:29: warning: declaration of 'i' shadows a previous local [-Wshadow]
                     for(int i=0;i<6;++i)pos[v[i]]=i;
                             ^
scales.cpp:96:13: note: shadowed declaration is here
     for(int i=1;i<=4;++i){
             ^
scales.cpp:177:33: warning: declaration of 'i' shadows a previous local [-Wshadow]
                         for(int i=0;i<6;++i)pos[v[i]]=i;
                                 ^
scales.cpp:96:13: note: shadowed declaration is here
     for(int i=1;i<=4;++i){
             ^
scales.cpp:189:37: warning: declaration of 'i' shadows a previous local [-Wshadow]
                             for(int i=0;i<6;++i)pos[v[i]]=i;
                                     ^
scales.cpp:96:13: note: shadowed declaration is here
     for(int i=1;i<=4;++i){
             ^
scales.cpp:202:33: warning: declaration of 'i' shadows a previous local [-Wshadow]
                         for(int i=0;i<6;++i)pos[v[i]]=i;
                                 ^
scales.cpp:96:13: note: shadowed declaration is here
     for(int i=1;i<=4;++i){
             ^
scales.cpp:212:37: warning: declaration of 'i' shadows a previous local [-Wshadow]
                             for(int i=0;i<6;++i)pos[v[i]]=i;
                                     ^
scales.cpp:96:13: note: shadowed declaration is here
     for(int i=1;i<=4;++i){
             ^
scales.cpp:224:41: warning: declaration of 'i' shadows a previous local [-Wshadow]
                                 for(int i=0;i<6;++i)pos[v[i]]=i;
                                         ^
scales.cpp:96:13: note: shadowed declaration is here
     for(int i=1;i<=4;++i){
             ^
scales.cpp:60:10: warning: variable 'pnow' set but not used [-Wunused-but-set-variable]
     auto pnow=[&](){
          ^~~~
scales.cpp: In function 'void init(int)':
scales.cpp:257:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T){}
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...