Submission #59172

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
591722018-07-20 22:02:12TadijaSebezUnscrambling a Messy Bug (IOI16_messy)C++11
100 / 100
4 ms512 KiB
#include "messy.h"
#include <stdio.h>
#include <vector>
#include <string>
#include <map>
#include <stdlib.h>
#include <ctime>
#include <algorithm>
using namespace std;
#define pb push_back
const int N=250;
int per[N];
vector<string> all;
map<string,bool> was;
int add,chk,m;
/*void add_element(string s){ all.pb(s);add++;}
void compile_set()
{
int i,j;
for(i=0;i<all.size();i++)
{
string tmp;
for(j=0;j<m;j++) tmp+='0';
for(j=0;j<m;j++) tmp[j]=all[i][per[j]];
was[tmp]=1;
}
}
bool check_element(string s){ chk++;return was[s];}*/
int n;
void Set(int l, int r)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

messy.cpp: In function 'void Set(int, int)':
messy.cpp:33:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int mid=l+r>>1,i,j;
          ~^~
messy.cpp:33:19: warning: unused variable 'j' [-Wunused-variable]
  int mid=l+r>>1,i,j;
                   ^
messy.cpp: In function 'void Solve(int, int, std::vector<int>)':
messy.cpp:44:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int mid=l+r>>1,i,j;
          ~^~
messy.cpp:47:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(i=0;i<v.size();i++) s[v[i]-1]='0';
          ~^~~~~~~~~
messy.cpp:49:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(i=0;i<v.size();i++)
          ~^~~~~~~~~
messy.cpp:44:19: warning: unused variable 'j' [-Wunused-variable]
  int mid=l+r>>1,i,j;
                   ^
messy.cpp: In function 'void test()':
messy.cpp:92:4: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    for(i=0;i<m;i++) printf("%i ",per[i]);printf("\n");
    ^~~
messy.cpp:92:42: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
    for(i=0;i<m;i++) printf("%i ",per[i]);printf("\n");
                                          ^~~~~~
messy.cpp:94:4: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    for(i=0;i<m;i++) printf("%i ",sol[i]);printf("\n");
    ^~~
messy.cpp:94:42: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
    for(i=0;i<m;i++) printf("%i ",sol[i]);printf("\n");
                                          ^~~~~~
messy.cpp:75:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%i",&t);
  ~~~~~^~~~~~~~~
#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...