Job 19593

Owner
Horia Turcuman
Problem
Keyboard
Contest
MindCoding 2017 Round 3 Take Off Labs (Div. 1)
Source
1.25KB
Result
Accepted

Compiler output

prog.cpp: In function 'int Dist(char, char)':
prog.cpp:16:18: warning: array subscript has type 'char' [-Wchar-subscripts]
  return abs(let[a].x - let[b].x) + abs(let[a].y - let[b].y);
                  ^
prog.cpp:16:29: warning: array subscript has type 'char' [-Wchar-subscripts]
  return abs(let[a].x - let[b].x) + abs(let[a].y - let[b].y);
                             ^
prog.cpp:16:45: warning: array subscript has type 'char' [-Wchar-subscripts]
  return abs(let[a].x - let[b].x) + abs(let[a].y - let[b].y);
                                             ^
prog.cpp:16:56: warning: array subscript has type 'char' [-Wchar-subscripts]
  return abs(let[a].x - let[b].x) + abs(let[a].y - let[b].y);
                                                        ^
prog.cpp: In function 'int main()':
prog.cpp:22:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < S.size(); i++)
                    ^
prog.cpp:23:11: warning: array subscript has type 'char' [-Wchar-subscripts]
   let[S[i]].x = 0, let[S[i]].y = i;
           ^
prog.cpp:23:28: warning: array subscript has type 'char' [-Wchar-subscripts]
   let[S[i]].x = 0, let[S[i]].y = i;
                            ^
prog.cpp:26:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < S.size(); i++)
                    ^
prog.cpp:27:11: warning: array subscript has type 'char' [-Wchar-subscripts]
   let[S[i]].x = 1, let[S[i]].y = i;
           ^
prog.cpp:27:28: warning: array subscript has type 'char' [-Wchar-subscripts]
   let[S[i]].x = 1, let[S[i]].y = i;
                            ^
prog.cpp:30:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < S.size(); i++)
                    ^
prog.cpp:31:11: warning: array subscript has type 'char' [-Wchar-subscripts]
   let[S[i]].x = 2, let[S[i]].y = i;
           ^
prog.cpp:31:28: warning: array subscript has type 'char' [-Wchar-subscripts]
   let[S[i]].x = 2, let[S[i]].y = i;
                            ^
prog.cpp:41:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < S.size(); i++)
                    ^
prog.cpp:43:19: warning: array subscript has type 'char' [-Wchar-subscripts]
   conf[i % 2][S[i]] = INF;
                   ^
prog.cpp:46:19: warning: array subscript has type 'char' [-Wchar-subscripts]
   conf[i % 2][last] = INF;
                   ^
prog.cpp:58:19: warning: array subscript has type 'char' [-Wchar-subscripts]
   conf[i % 2][last] = best;
                   ^
prog.cpp:45:24: warning: variable 'le' set but not used [-Wunused-but-set-variable]
   int best = INF; char le;
                        ^

Results

Test numberResultTime
1Ok0.5281s
2Ok0.5326s
3Ok0.5191s
4Ok0.4965s
5Ok0.5257s
6Ok0.5354s
7Ok0.5108s
8Ok0.5475s
9Ok0.4914s
10Ok0.4665s
Questions?

Sponsors Gold