제출 #166141

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1661412019-11-30 22:50:39gabrc52Miners (IOI07_miners)C++14
100 / 100
693 ms110200 KiB
#include <iostream>
#include <unordered_map>
#include <cstring>
using namespace std;
const int MAXN = 100000;
char shipment[MAXN + 2];
int N;
int memo[MAXN][4][4][4][4];
struct Prev {
char a[2][2];
};
Prev give(int pos, int mine, Prev prev) {
prev.a[mine][0] = prev.a[mine][1];
prev.a[mine][1] = shipment[pos];
return prev;
}
int diff(int pos, int mine, Prev prev) {
int foodCount[150] = {0};
foodCount[prev.a[mine][0]]++;
foodCount[prev.a[mine][1]]++;
foodCount[shipment[pos]]++;
int typesOfFood = 0;
if (foodCount['M'])
typesOfFood++;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

miners.cpp: In function 'int diff(int, int, Prev)':
miners.cpp:25:27: warning: array subscript has type 'char' [-Wchar-subscripts]
  foodCount[prev.a[mine][0]]++;
                           ^
miners.cpp:26:27: warning: array subscript has type 'char' [-Wchar-subscripts]
  foodCount[prev.a[mine][1]]++;
                           ^
miners.cpp:27:25: warning: array subscript has type 'char' [-Wchar-subscripts]
  foodCount[shipment[pos]]++;
                         ^
miners.cpp: In function 'int F(int, Prev)':
miners.cpp:44:46: warning: array subscript has type 'char' [-Wchar-subscripts]
   int &m = memo[pos][ conversion[prev.a[0][0]] ][ conversion[prev.a[0][1]] ][ conversion[prev.a[1][0]] ][ conversion[prev.a[1][1]] ];
                                              ^
miners.cpp:44:74: warning: array subscript has type 'char' [-Wchar-subscripts]
   int &m = memo[pos][ conversion[prev.a[0][0]] ][ conversion[prev.a[0][1]] ][ conversion[prev.a[1][0]] ][ conversion[prev.a[1][1]] ];
                                                                          ^
miners.cpp:44:102: warning: array subscript has type 'char' [-Wchar-subscripts]
   int &m = memo[pos][ conversion[prev.a[0][0]] ][ conversion[prev.a[0][1]] ][ conversion[prev.a[1][0]] ][ conversion[prev.a[1][1]] ];
                                                                                                      ^
miners.cpp:44:130: warning: array subscript has type 'char' [-Wchar-subscripts]
   int &m = memo[pos][ conversion[prev.a[0][0]] ][ conversion[prev.a[0][1]] ][ conversion[prev.a[1][0]] ][ conversion[prev.a[1][1]] ];
                                                                                                                                  ^
#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...
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...