Submission #61010397
Source Code Expand
// LUOGU_RID: 195646990
#include <bits/stdc++.h>
using namespace std;
string standard[20][27][110] = {
{{
"...........########...........",
".........############.........",
".......################.......",
"......##################......",
".....####################.....",
"....######################....",
"...########################...",
"...##########....##########...",
"..#########........#########..",
"..########..........########..",
".#########..........#########.",
".########............########.",
".########............########.",
".########............########.",
"########..............########",
"########..............########",
"########..............########",
"########..............########",
"########..............########",
"########..............########",
"########..............########",
"########..............########",
"########..............########",
"########..............########",
"########..............########",
".########............########.",
".########............########.",
".########............########.",
".#########..........#########.",
"..########..........########..",
"..#########........#########..",
"...##########....##########...",
"...########################...",
"....######################....",
".....####################.....",
"......##################......",
".......################.......",
".........############.........",
"...........########...........",
}},
{{
".............####..........",
"...........#######.........",
"........##########.........",
".....#############.........",
"..################.........",
".#################.........",
".#################.........",
".#################.........",
".#################.........",
"..######..########.........",
"..###.....########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
"..........########.........",
".##########################",
"###########################",
"###########################",
"###########################",
"###########################",
".##########################",
}},
{{
".........#########..........",
"......##############........",
"...###################......",
"..#####################.....",
".#######################....",
".#######################....",
".########################...",
".#########......#########...",
".#######.........#########..",
".#######..........########..",
".#######..........########..",
".#######..........########..",
".#######..........########..",
"..######..........########..",
".................#########..",
".................########...",
"................#########...",
"...............##########...",
"..............##########....",
".............###########....",
"............###########.....",
"...........###########......",
"..........###########.......",
".........###########........",
"........###########.........",
".......###########..........",
"......###########.....#####.",
".....###########.....#######",
"....###########......#######",
"...###########.......#######",
"..###########........#######",
".###########.........#######",
"############################",
"############################",
"############################",
"############################",
"############################",
".###########################",
}},
{{
".........##########.........",
".....################.......",
"...####################.....",
"..######################....",
"..#######################...",
"..########################..",
"..########################..",
"..########.......##########.",
"..#######.........#########.",
"..#######..........########.",
"..#######..........########.",
"...######..........########.",
"...................########.",
"...................########.",
"..................########..",
".................#########..",
"..........###############...",
".........###############....",
".........##############.....",
".........###############....",
".........################...",
"..........################..",
".................##########.",
"...................########.",
"...................#########",
"....................########",
"....................########",
"....................########",
"....................########",
"...................#########",
"..###.............##########",
".########........##########.",
".##########################.",
".#########################..",
"##########################..",
".########################...",
".######################.....",
"....#################.......",
".......###########..........",
}},
{{
".................#####........",
"................#######.......",
"...............########.......",
"..............#########.......",
".............##########.......",
"............###########.......",
"............###########.......",
"...........############.......",
"..........#############.......",
".........##############.......",
"........###############.......",
".......################.......",
".......########.#######.......",
"......########..#######.......",
".....########...#######.......",
"....########....#######.......",
"...#########....#######.......",
"...########.....#######.......",
"..########......#######.......",
".########.......#######.......",
"##############################",
"##############################",
"##############################",
"##############################",
"##############################",
"##############################",
"...............########.......",
"...............########.......",
"...............########.......",
"...............########.......",
"...............########.......",
"...............########.......",
".........####################.",
"........#####################.",
"........#####################.",
"........#####################.",
"........#####################.",
".........####################.",
}},
{{
"...######################...",
"...#######################..",
"...#######################..",
"...#######################..",
"...#######################..",
"...######################...",
"...#######..................",
"...#######..................",
"...#######..................",
"...#######..................",
"...#######..................",
"...#######..................",
"..########..########........",
"..####################......",
"..######################....",
"..#######################...",
"..########################..",
"..########################..",
"..#########################.",
"..########.......##########.",
".....##...........#########.",
"...................#########",
"....................########",
"....................########",
"....................########",
"....................########",
"....................########",
"....................########",
"...#...............#########",
"..####............#########.",
".########.......###########.",
".##########################.",
".#########################..",
"#########################...",
".#######################....",
"..#####################.....",
"....#################.......",
"........##########..........",
}},
{{
"....................######...",
"...............###########...",
"............###############..",
"..........#################..",
"........###################..",
".......####################..",
"......####################...",
".....################........",
"....############.............",
"...###########...............",
"...#########.................",
"..#########..................",
"..########...................",
".########....................",
".########....................",
".#######....########.........",
".#######..#############......",
"#########################....",
"##########################...",
"###########################..",
"###########################..",
"############......##########.",
"##########.........#########.",
"#########...........#########",
"########.............########",
"########.............########",
"########.............########",
".#######.............########",
".#######.............########",
".########...........#########",
".#########.........#########.",
"..##########.....###########.",
"...#########################.",
"...########################..",
"....######################...",
".....####################....",
"......##################.....",
"........##############.......",
"...........########..........",
}},
{{
"###########################.",
"############################",
"############################",
"############################",
"############################",
"###########################.",
"#######...........#########.",
"#######...........#########.",
"#######..........#########..",
"#######..........#########..",
"#######..........########...",
"#######.........#########...",
"#######.........########....",
"#######........#########....",
".#####.........#########....",
"...............########.....",
"..............#########.....",
"..............########......",
".............#########......",
".............########.......",
"............#########.......",
"............#########.......",
"............########........",
"...........#########........",
"...........########.........",
"..........#########.........",
"..........########..........",
"..........########..........",
".........########...........",
".........########...........",
"........#########...........",
"........########............",
"........########............",
".......########.............",
".......########.............",
".......#######..............",
".......#######..............",
".........#####..............",
}},
{{
"..........#########.........",
"........#############.......",
"......#################.....",
".....###################....",
"....#####################...",
"...#######################..",
"...#######################..",
"...#########.....#########..",
"..#########.......#########.",
"..########.........########.",
"..########.........########.",
"..########.........########.",
"..########.........########.",
"..########.........########.",
"...########.......########..",
"...#########.....#########..",
"....#####################...",
".....###################....",
"......#################.....",
"......#################.....",
"....#####################...",
"...#######################..",
"..#########......##########.",
".########..........########.",
".########..........#########",
"########............########",
"########............########",
"########............########",
"########............########",
"#########..........#########",
"#########..........#########",
".##########......##########.",
".##########################.",
"..########################..",
"..########################..",
"...######################...",
"....####################....",
"......################......",
".........##########.........",
}},
{{
".........#########..........",
".......#############........",
".....#################......",
"....###################.....",
"...#####################....",
"..#######################...",
".########################...",
".##########......#########..",
".#########........#########.",
"#########..........########.",
"########............#######.",
"########............#######.",
"########............########",
"########............########",
"########............########",
"#########..........#########",
".########.........##########",
".##########......###########",
"..##########################",
"..##########################",
"...#########################",
"....########################",
"......############..########",
"........########....#######.",
"....................#######.",
"...................########.",
"...................########.",
"..................########..",
".................#########..",
"...............##########...",
".............############...",
".........###############....",
"....###################.....",
"...###################......",
"...##################.......",
"...################.........",
"...##############...........",
"...############.............",
"....######..................",
}},
{{
"...............####..",
"..............######.",
"............########.",
"...........##########",
"..........###########",
".........############",
"........############.",
".......###########...",
"......###########....",
".....###########.....",
".....##########......",
"....##########.......",
"....#########........",
"...#########.........",
"...########..........",
"..#########..........",
"..########...........",
".#########...........",
".########............",
".########............",
".########............",
"#########............",
"########.............",
"########.............",
"########.............",
"########.............",
"########.............",
"########.............",
"########.............",
"########.............",
"########.............",
"########.............",
".########............",
".########............",
".########............",
".#########...........",
"..########...........",
"..#########..........",
"..#########..........",
"...#########.........",
"...##########........",
"....#########........",
".....#########.......",
".....##########......",
"......###########....",
".......###########...",
"........###########..",
".........############",
"..........###########",
"...........##########",
"............#########",
".............#######.",
"...............####..",
".................#...",
}},
{{
"..####...............",
".######..............",
"#########............",
"##########...........",
"###########..........",
"############.........",
".############........",
"...###########.......",
"....###########......",
".....##########......",
"......##########.....",
".......##########....",
"........#########....",
".........#########...",
"..........########...",
"..........#########..",
"...........########..",
"...........#########.",
"............########.",
"............########.",
"............########.",
"............#########",
".............########",
".............########",
".............########",
".............########",
".............########",
".............########",
".............########",
".............########",
".............########",
".............########",
"............########.",
"............########.",
"............########.",
"...........#########.",
"...........########..",
"..........#########..",
"..........#########..",
".........#########...",
"........##########...",
".......##########....",
".......#########.....",
".....###########.....",
"....###########......",
"...###########.......",
"..###########........",
"############.........",
"###########..........",
"##########...........",
"#########............",
".#######.............",
"..####...............",
"...#.................",
}},
{{
"...........#####...........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"###########################",
"###########################",
"###########################",
"###########################",
"###########################",
"###########################",
"###########################",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"..........#######..........",
"...........#####...........",
}},
{{
".##########################.",
"############################",
"############################",
"############################",
"############################",
"############################",
".###########################",
}},
{{
"...........####...........",
"..........######..........",
"..........#######.........",
".........########.........",
".........########.........",
"..........#######.........",
"..........######..........",
".#####....######.....####.",
".######...######...#######",
"#########..#####.#########",
"###############.##########",
"##########################",
"##########################",
".########################.",
"......##############......",
".........########.........",
"........###########.......",
".......#############......",
".....########.#######.....",
"....########..########....",
"....########..#########...",
"...########....########...",
"...########....########...",
"....#######.....#######...",
".....#####......######....",
"......###.........##......",
}},
{{
"......................####..",
"......................######",
".....................#######",
".....................#######",
"....................########",
"....................#######.",
"...................########.",
"...................#######..",
"..................########..",
"..................#######...",
".................########...",
".................#######....",
"................########....",
"................########....",
"................#######.....",
"...............########.....",
"...............#######......",
"..............########......",
"..............#######.......",
".............########.......",
".............#######........",
"............########........",
"............#######.........",
"...........########.........",
"...........#######..........",
"..........########..........",
"..........#######...........",
"..........#######...........",
".........########...........",
".........#######............",
"........########............",
"........#######.............",
".......########.............",
".......#######..............",
"......########..............",
"......#######...............",
".....########...............",
".....#######................",
"....########................",
"....#######.................",
"...########.................",
"...########.................",
"...#######..................",
"..########..................",
"..#######...................",
".########...................",
".#######....................",
"########....................",
"#######.....................",
".######.....................",
"..#####.....................",
}}};
// below part by BLX32M_10
#define int long long
int t, w, h; // 65*38
int sz[][27] = {{39}, {38}, {38}, {39}, {38}, {38}, {39}, {38}, {39}, {39}, {54}, {54}, {28}, {7}, {26}, {51}};
char mp[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '(', ')', '+', '-', '*', '/'};
#define mkp make_pair
string s[70];
int vis[70][9005];
const int dx[] = {-1, 1, 0, 0}, dy[] = {0, 0, -1, 1};
namespace NoiseReduction
{
inline int BFSBlock(char tp, int x, int y, int g)
{
queue <pair <int, int> > q;
q.push(mkp(x, y));
vis[x][y] = g + 1;
int res = 0;
while (!q.empty())
{
res++;
int x = q.front().first, y = q.front().second;
q.pop();
for (int i = 0; i < 4; i++)
{
int nx = x + dx[i], ny = y + dy[i];
if (nx >= 0 && nx < h && ny >= 0 && ny < w && vis[nx][ny] == g && s[nx][ny] == tp)
q.push(mkp(nx, ny)), vis[nx][ny] = g + 1;
}
if (g == 1)
s[x][y] = (s[x][y] == '.' ? '#' : '.');
}
return res;
}
inline void Brush(int vx, int vy)
{
int sx = (vx == 1 ? 0 : h - 1), ex = (vx == 1 ? h - 1 : 0);
int sy = (vy == 1 ? 0 : w - 1), ey = (vy == 1 ? w - 1 : 0);
#define rep(i, x, y) for (int i = x; (x <= y ? i <= y : i >= y); (x <= y ? i++ : i--))
if (vx != 0)
rep(i, sx, ex)
{
rep(j, sy, ey)
{
if (s[i][j] == '#')
{
int nn = 0;
for (int k = 0; k < 4; k++)
{
int x = i + dx[k], y = j + dy[k];
if (x < 0 || x >= h || y < 0 || y >= w)
nn++;
else
nn += (s[x][y] == '.');
}
if (nn >= 3)
s[i][j] = '.';
}
}
}
else
rep(j, sy, ey)
{
rep(i, sx, ex)
{
if (s[i][j] == '#')
{
int nn = 0;
for (int k = 0; k < 4; k++)
{
int x = i + dx[k], y = j + dy[k];
if (x < 0 || x >= h || y < 0 || y >= w)
nn++;
else
nn += (s[x][y] == '.');
}
if (nn == 3)
s[i][j] = '.';
}
}
}
}
inline void SharpRemove()
{
Brush(0, 1);
Brush(0, -1);
Brush(-1, 0);
Brush(1, 0);
}
signed main()
{
for (int i = 0; i < h; i++)
{
for (int j = 0; j < w; j++)
{
if (!vis[i][j])
{
if (BFSBlock(s[i][j], i, j, 0) <= 15)
{
BFSBlock(s[i][j], i, j, 1);
}
}
}
}
SharpRemove();
return 0;
}
}
namespace PreprocessPic
{
// 4 5 6 7 8 10 12 14 18
const int TAN[] = {3, 4, 5, 6, 7, 8, 9,10, 12, 14, 16, 18}, SZ = 12;
signed main()
{
for (int i = 0; i < 16; i++)
{
int cur = 1;
for (int j = 0; j < SZ * 2; j++)
{
for (int x = 0; x < sz[i][0]; x++)
{
standard[i][cur][x] = standard[i][0][x];
standard[i][cur][x].resize(100, '.');
// for (int xx = 0; xx < 50; xx++)
// standard[i][cur][x] += '.';
}
for (int x = sz[i][0]; x <= 50 + sz[i][0]; x++)
{
standard[i][cur][x].resize(100, '.');
}
sz[i][cur] = sz[i][0] + 50;
if (j < SZ)
{
string ss = "";
for (int x = 1; x < sz[i][cur]; x++)
{
if (x % TAN[j % SZ] == 0)
ss += '.';
standard[i][cur][x] = ss + standard[i][cur][x];
standard[i][cur][x] = standard[i][cur][x].substr(0, standard[i][cur][0].size());
}
int cc = 0;
for (int y = standard[i][cur][0].size() - 1; y >= 0; y--)
{
if (y % TAN[j % SZ] == 0)
cc++;
for (int x = sz[i][cur] - 1; x >= 0; x--)
{
if (x - cc < 0)
standard[i][cur][x][y] = '.';
else
standard[i][cur][x][y] = standard[i][cur][x - cc][y];
}
}
}
else
{
// printf("now:%lld end:%lld\n", j, SZ * 2);
string ss = "";
for (int x = sz[i][cur] - 1; x >= 0; x--)
{
// standard[i][cur][x].resize(100, '.');
if (x % TAN[j % SZ] == 0)
ss += '.';
standard[i][cur][x] = ss + standard[i][cur][x];
standard[i][cur][x] = standard[i][cur][x].substr(0, standard[i][cur][0].size());
}
int cc = 0;
for (int y = 0; y < standard[i][cur][1].size(); y++)
{
if (y % TAN[j % SZ] == 0)
cc++;
// printf("%lld\n", cc);
for (int x = sz[i][cur] - 1; x >= 0; x--)
{
// printf("(%lld, %lld)\n", x, y);
if (x - cc < 0)
standard[i][cur][x][y] = '.';
else
standard[i][cur][x][y] = standard[i][cur][x - cc][y];
}
}
}
int cc = 0;
for (int x = 0; x < sz[i][cur]; x++)
{
if (standard[i][cur][x].find('#') == string :: npos)
cc++;
else
break;
}
for (int x = 0; x < sz[i][cur]; x++)
{
if (x + cc < sz[i][cur])
standard[i][cur][x] = standard[i][cur][x + cc];
else
standard[i][cur][x].clear(), standard[i][cur][x].resize(80, '.');
}
for (int x = 0; x < sz[i][cur]; x++)
{
if (standard[i][cur][x].find('#') == string :: npos)
{
sz[i][cur] = x;
break;
}
}
int lw = 0, lg = 10000;
for (int y = 0; y < standard[i][cur][1].size(); y++)
{
bool b = 1;
for (int x = 0; x < sz[i][cur]; x++)
{
if (standard[i][cur][x][y] == '#')
{
b = 0;
break;
}
}
if (!b)
{
lw = y;
break;
}
}
for (int y = lw + 1; y < standard[i][cur][1].size(); y++)
{
bool b = 1;
for (int x = 0; x < sz[i][cur]; x++)
{
if (standard[i][cur][x][y] == '#')
{
b = 0;
break;
}
}
if (b)
{
lg = y - lw;
break;
}
}
for (int x = 0; x < sz[i][cur]; x++)
standard[i][cur][x] = standard[i][cur][x].substr(lw, lg);
// if (i == 13)
// {
// for (int x = 0; x < sz[i][cur]; x++)
// {
// cout << standard[i][cur][x] << endl;
// }
// cout << endl;
// }
cur++;
}
}
return 0;
}
}
string res;
namespace Match
{
#define ppp pair <pair <int, int>, pair <int, int> >
inline ppp find(int x, int y)
{
vis[x][y] = 1;
ppp p = make_pair(make_pair(x, y), make_pair(x, y));
for (int d = 0; d < 4; d++)
{
int nx = x + dx[d], ny = y + dy[d];
if (nx >= 0 && ny >= 0 && nx < h && ny < w && !vis[nx][ny] && s[nx][ny] == '#')
{
ppp cur = find(nx, ny);
p.first.first = min(p.first.first, cur.first.first);
p.first.second = min(p.first.second, cur.first.second);
p.second.first = max(p.second.first, cur.second.first);
p.second.second = max(p.second.second, cur.second.second);
}
}
return p;
}
// #define map unordered_map
inline map <char, long double> match(int x1, int y1, int x2, int y2)
{
map <char, long double> res;
for (int i = 0; i < 16; i++)
{
for (int xx = 0; xx < PreprocessPic::SZ * 2; xx++)
{
int h = sz[i][xx], w = standard[i][xx][0].size();
int mc = (x2 - x1 + 1) * (y2 - y1 + 1);
double x = 1.0 * (x2 - x1 + 1) / (y2 - y1 + 1), y = 1.0 * h / w;
double l = min(x, y) / max(x, y);
if (l <= 0.35)
continue;
for (int x = x1; x <= x2; x++)
{
for (int y = y1; y <= y2; y++)
{
if (s[x][y] != standard[i][xx][(int)((x - x1) * 1.0 / (x2 - x1) * h)][(int)((y - y1) * 1.0 / (y2 - y1) * w)])
{
mc--;
}
}
}
res[mp[i]] = max(res[mp[i]], mc * (long double)1.0 / (x2 - x1 + 1) / (y2 - y1 + 1));
}
}
return res;
}
signed main()
{
memset(vis, 0, sizeof vis);
for (int j = 0; j < w; j++)
{
for (int i = 0; i < h; i++)
{
if (s[i][j] == '#' && !vis[i][j])
{
// printf("%ld block:\n", res.size() + 1);
ppp p = find(i, j);
map <char, long double> mp = match(p.first.first, p.first.second, p.second.first, p.second.second);
pair <char, long double> pp = make_pair('?', 0);
for (auto p : mp)
{
if (p.second > pp.second)
{
if (res.size() > 0 && (res[res.size() - 1] < '0' || res[res.size() - 1] > '9') && res[res.size() - 1] != ')' && (p.first == '+' || p.first == '-' || p.first == '*' || p.first == '/' || p.first == ')'))
continue;
if (res.size() > 0 && (res[res.size() - 1] >= '0' && res[res.size() - 1] <= '9') && !(p.first == '+' || p.first == '-' || p.first == '*' || p.first == '/' || p.first == ')'))
continue;
pp = p;
// printf("%c:%.2Lf%%\n", p.first, p.second * 100);
}
}
// printf("RES:%c\n", pp.first);
res.push_back(pp.first);
if (pp.first == '?')
{
while(1);
}
}
}
}
// cout << res << endl;
return 0;
}
}
namespace Print
{
signed main()
{
for (int i = 0; i < h; i++)
{
cout << s[i] << endl;
}
return 0;
}
}
namespace Calculate
{
string bk;
inline void build() // Strong building postfix notation without dfs.
{
bk.clear();
stack <char> st;
for (char c : res)
{
if (c >= '0' && c <= '9')
bk.push_back(c);
else if (c == '(')
st.push('(');
else if (c == ')')
{
while (!st.empty() && st.top() != '(')
bk.push_back(st.top()), st.pop();
st.pop();
}
else if (c == '*' || c == '/')
{
while (!st.empty() && (st.top() == '*' || st.top() == '/'))
bk.push_back(st.top()), st.pop();
st.push(c);
}
else if (c == '+' || c == '-')
{
while (!st.empty() && st.top() != '(')
bk.push_back(st.top()), st.pop();
st.push(c);
}
}
while (!st.empty())
bk.push_back(st.top()), st.pop();
}
stack <int> st;
inline pair <int, int> gettop()
{
int a = st.top(), b;
st.pop();
b = st.top();
st.pop();
return make_pair(b, a);
}
inline int calc()
{
for (char c : bk)
{
if (c >= '0' && c <= '9')
st.push(c - '0');
else
{
pair <int, int> p = gettop();
if (c == '+')
st.push(p.first + p.second);
if (c == '-')
st.push(p.first - p.second);
if (c == '*')
st.push(p.first * p.second);
if (c == '/')
st.push(p.first / p.second);
}
}
return st.top();
}
}
signed main()
{
// freopen("pic.in", "r", stdin);
// freopen("pic.out", "w", stdout);
PreprocessPic::main();
scanf("%lld %lld %lld", &t, &w, &h);
for (int i = 0; i < h; i++)
{
cin >> s[i];
}
NoiseReduction::main();
// Print::main();
Match::main();
// cout << res << endl;
int c0 = 0, c1 = 0;
for (char c : res)
{
if (c == ')')
c1++;
else if (c == '(')
c0++;
}
if (c1 > c0)
{
int cnt = 0;
for (int i = 0; i < res.size(); i++)
{
if (res[i] == '/')
{
cnt++;
if (cnt == 2)
{
res[i] = '(';
break;
}
}
}
}
Calculate::build();
printf("%lld\n", Calculate::calc());
return 0;
}
Submission Info
Compile Error
Main.cpp: In function ‘int PreprocessPic::main()’:
Main.cpp:810:19: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
810 | for (int y = 0; y < standard[i][cur][1].size(); y++)
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:849:19: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
849 | for (int y = 0; y < standard[i][cur][1].size(); y++)
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:866:24: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
866 | for (int y = lw + 1; y < standard[i][cur][1].size(); y++)
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp: In function ‘int main()’:
Main.cpp:1090:19: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
1090 | for (int i = 0; i < res.size(); i++)
| ~~^~~~~~~~~~~~
Main.cpp:1070:6: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
1070 | scanf("%lld %lld %lld", &t, &w, &h);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Judge Result
| Set Name |
Case0 |
Case1 |
Case2 |
Case3 |
Case4 |
Case5 |
Case6 |
Case7 |
Case8 |
Case9 |
Case10 |
Case11 |
Case12 |
Case13 |
Case14 |
Case15 |
Case16 |
Case17 |
Case18 |
Case19 |
Case20 |
Case21 |
Case22 |
Case23 |
Case24 |
Case25 |
Case26 |
Case27 |
Case28 |
Case29 |
Case30 |
Case31 |
Case32 |
Case33 |
Case34 |
Case35 |
Case36 |
Case37 |
Case38 |
Case39 |
Case40 |
Case41 |
Case42 |
Case43 |
Case44 |
Case45 |
Case46 |
Case47 |
Case48 |
Case49 |
Case50 |
Case51 |
Case52 |
Case53 |
Case54 |
Case55 |
Case56 |
Case57 |
Case58 |
Case59 |
Case60 |
Case61 |
Case62 |
Case63 |
Case64 |
Case65 |
Case66 |
Case67 |
Case68 |
Case69 |
Case70 |
Case71 |
Case72 |
Case73 |
Case74 |
Case75 |
Case76 |
Case77 |
Case78 |
Case79 |
Case80 |
Case81 |
Case82 |
Case83 |
Case84 |
Case85 |
Case86 |
Case87 |
Case88 |
Case89 |
Case90 |
Case91 |
Case92 |
Case93 |
Case94 |
Case95 |
Case96 |
Case97 |
Case98 |
Case99 |
Case100 |
Case101 |
Case102 |
Case103 |
Case104 |
Case105 |
Case106 |
Case107 |
Case108 |
Case109 |
Case110 |
Case111 |
Case112 |
Case113 |
Case114 |
Case115 |
Case116 |
Case117 |
Case118 |
Case119 |
Case120 |
Case121 |
Case122 |
Case123 |
Case124 |
Case125 |
Case126 |
Case127 |
Case128 |
Case129 |
Case130 |
Case131 |
Case132 |
Case133 |
Case134 |
Case135 |
Case136 |
Case137 |
Case138 |
Case139 |
| Score / Max Score |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
2 / 2 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
4 / 4 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
5 / 5 |
| Status |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Set Name |
Test Cases |
| Case0 |
000.txt |
| Case1 |
001.txt |
| Case2 |
002.txt |
| Case3 |
003.txt |
| Case4 |
004.txt |
| Case5 |
005.txt |
| Case6 |
006.txt |
| Case7 |
007.txt |
| Case8 |
008.txt |
| Case9 |
009.txt |
| Case10 |
010.txt |
| Case11 |
011.txt |
| Case12 |
012.txt |
| Case13 |
013.txt |
| Case14 |
014.txt |
| Case15 |
015.txt |
| Case16 |
016.txt |
| Case17 |
017.txt |
| Case18 |
018.txt |
| Case19 |
019.txt |
| Case20 |
020.txt |
| Case21 |
021.txt |
| Case22 |
022.txt |
| Case23 |
023.txt |
| Case24 |
024.txt |
| Case25 |
025.txt |
| Case26 |
026.txt |
| Case27 |
027.txt |
| Case28 |
028.txt |
| Case29 |
029.txt |
| Case30 |
030.txt |
| Case31 |
031.txt |
| Case32 |
032.txt |
| Case33 |
033.txt |
| Case34 |
034.txt |
| Case35 |
035.txt |
| Case36 |
036.txt |
| Case37 |
037.txt |
| Case38 |
038.txt |
| Case39 |
039.txt |
| Case40 |
040.txt |
| Case41 |
041.txt |
| Case42 |
042.txt |
| Case43 |
043.txt |
| Case44 |
044.txt |
| Case45 |
045.txt |
| Case46 |
046.txt |
| Case47 |
047.txt |
| Case48 |
048.txt |
| Case49 |
049.txt |
| Case50 |
050.txt |
| Case51 |
051.txt |
| Case52 |
052.txt |
| Case53 |
053.txt |
| Case54 |
054.txt |
| Case55 |
055.txt |
| Case56 |
056.txt |
| Case57 |
057.txt |
| Case58 |
058.txt |
| Case59 |
059.txt |
| Case60 |
060.txt |
| Case61 |
061.txt |
| Case62 |
062.txt |
| Case63 |
063.txt |
| Case64 |
064.txt |
| Case65 |
065.txt |
| Case66 |
066.txt |
| Case67 |
067.txt |
| Case68 |
068.txt |
| Case69 |
069.txt |
| Case70 |
070.txt |
| Case71 |
071.txt |
| Case72 |
072.txt |
| Case73 |
073.txt |
| Case74 |
074.txt |
| Case75 |
075.txt |
| Case76 |
076.txt |
| Case77 |
077.txt |
| Case78 |
078.txt |
| Case79 |
079.txt |
| Case80 |
080.txt |
| Case81 |
081.txt |
| Case82 |
082.txt |
| Case83 |
083.txt |
| Case84 |
084.txt |
| Case85 |
085.txt |
| Case86 |
086.txt |
| Case87 |
087.txt |
| Case88 |
088.txt |
| Case89 |
089.txt |
| Case90 |
090.txt |
| Case91 |
091.txt |
| Case92 |
092.txt |
| Case93 |
093.txt |
| Case94 |
094.txt |
| Case95 |
095.txt |
| Case96 |
096.txt |
| Case97 |
097.txt |
| Case98 |
098.txt |
| Case99 |
099.txt |
| Case100 |
100.txt |
| Case101 |
101.txt |
| Case102 |
102.txt |
| Case103 |
103.txt |
| Case104 |
104.txt |
| Case105 |
105.txt |
| Case106 |
106.txt |
| Case107 |
107.txt |
| Case108 |
108.txt |
| Case109 |
109.txt |
| Case110 |
110.txt |
| Case111 |
111.txt |
| Case112 |
112.txt |
| Case113 |
113.txt |
| Case114 |
114.txt |
| Case115 |
115.txt |
| Case116 |
116.txt |
| Case117 |
117.txt |
| Case118 |
118.txt |
| Case119 |
119.txt |
| Case120 |
120.txt |
| Case121 |
121.txt |
| Case122 |
122.txt |
| Case123 |
123.txt |
| Case124 |
124.txt |
| Case125 |
125.txt |
| Case126 |
126.txt |
| Case127 |
127.txt |
| Case128 |
128.txt |
| Case129 |
129.txt |
| Case130 |
130.txt |
| Case131 |
131.txt |
| Case132 |
132.txt |
| Case133 |
133.txt |
| Case134 |
134.txt |
| Case135 |
135.txt |
| Case136 |
136.txt |
| Case137 |
137.txt |
| Case138 |
138.txt |
| Case139 |
139.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 000.txt |
AC |
12 ms |
13384 KiB |
| 001.txt |
AC |
11 ms |
13388 KiB |
| 002.txt |
AC |
11 ms |
13384 KiB |
| 003.txt |
AC |
12 ms |
13392 KiB |
| 004.txt |
AC |
12 ms |
13484 KiB |
| 005.txt |
AC |
12 ms |
13516 KiB |
| 006.txt |
AC |
11 ms |
13480 KiB |
| 007.txt |
AC |
12 ms |
13388 KiB |
| 008.txt |
AC |
12 ms |
13612 KiB |
| 009.txt |
AC |
11 ms |
13376 KiB |
| 010.txt |
AC |
12 ms |
13408 KiB |
| 011.txt |
AC |
12 ms |
13540 KiB |
| 012.txt |
AC |
12 ms |
13424 KiB |
| 013.txt |
AC |
13 ms |
13356 KiB |
| 014.txt |
AC |
12 ms |
13404 KiB |
| 015.txt |
AC |
12 ms |
13384 KiB |
| 016.txt |
AC |
12 ms |
13280 KiB |
| 017.txt |
AC |
14 ms |
13400 KiB |
| 018.txt |
AC |
12 ms |
13276 KiB |
| 019.txt |
AC |
12 ms |
13424 KiB |
| 020.txt |
AC |
12 ms |
13400 KiB |
| 021.txt |
AC |
11 ms |
13400 KiB |
| 022.txt |
AC |
12 ms |
13520 KiB |
| 023.txt |
AC |
11 ms |
13496 KiB |
| 024.txt |
AC |
11 ms |
13512 KiB |
| 025.txt |
AC |
11 ms |
13484 KiB |
| 026.txt |
AC |
11 ms |
13472 KiB |
| 027.txt |
AC |
11 ms |
13384 KiB |
| 028.txt |
AC |
12 ms |
13344 KiB |
| 029.txt |
AC |
12 ms |
13396 KiB |
| 030.txt |
AC |
39 ms |
13720 KiB |
| 031.txt |
AC |
39 ms |
13732 KiB |
| 032.txt |
AC |
39 ms |
13512 KiB |
| 033.txt |
AC |
41 ms |
13640 KiB |
| 034.txt |
AC |
38 ms |
13664 KiB |
| 035.txt |
AC |
38 ms |
13716 KiB |
| 036.txt |
AC |
39 ms |
13620 KiB |
| 037.txt |
AC |
39 ms |
13636 KiB |
| 038.txt |
AC |
40 ms |
13620 KiB |
| 039.txt |
AC |
40 ms |
13724 KiB |
| 040.txt |
AC |
40 ms |
13732 KiB |
| 041.txt |
AC |
40 ms |
13652 KiB |
| 042.txt |
AC |
39 ms |
13580 KiB |
| 043.txt |
AC |
40 ms |
13616 KiB |
| 044.txt |
AC |
42 ms |
13724 KiB |
| 045.txt |
AC |
42 ms |
13632 KiB |
| 046.txt |
AC |
40 ms |
13672 KiB |
| 047.txt |
AC |
38 ms |
13668 KiB |
| 048.txt |
AC |
40 ms |
13720 KiB |
| 049.txt |
AC |
38 ms |
13620 KiB |
| 050.txt |
AC |
38 ms |
13776 KiB |
| 051.txt |
AC |
41 ms |
13748 KiB |
| 052.txt |
AC |
40 ms |
13656 KiB |
| 053.txt |
AC |
40 ms |
13764 KiB |
| 054.txt |
AC |
40 ms |
13636 KiB |
| 055.txt |
AC |
31 ms |
13764 KiB |
| 056.txt |
AC |
33 ms |
13772 KiB |
| 057.txt |
AC |
45 ms |
13512 KiB |
| 058.txt |
AC |
37 ms |
13616 KiB |
| 059.txt |
AC |
34 ms |
13512 KiB |
| 060.txt |
AC |
38 ms |
13528 KiB |
| 061.txt |
AC |
35 ms |
13600 KiB |
| 062.txt |
AC |
40 ms |
13720 KiB |
| 063.txt |
AC |
35 ms |
13392 KiB |
| 064.txt |
AC |
39 ms |
13728 KiB |
| 065.txt |
AC |
38 ms |
13612 KiB |
| 066.txt |
AC |
36 ms |
13588 KiB |
| 067.txt |
AC |
33 ms |
13396 KiB |
| 068.txt |
AC |
36 ms |
13648 KiB |
| 069.txt |
AC |
37 ms |
13652 KiB |
| 070.txt |
AC |
39 ms |
13516 KiB |
| 071.txt |
AC |
39 ms |
13712 KiB |
| 072.txt |
AC |
41 ms |
13828 KiB |
| 073.txt |
AC |
40 ms |
13664 KiB |
| 074.txt |
AC |
40 ms |
13584 KiB |
| 075.txt |
AC |
40 ms |
13764 KiB |
| 076.txt |
AC |
36 ms |
13524 KiB |
| 077.txt |
AC |
41 ms |
13652 KiB |
| 078.txt |
AC |
40 ms |
13668 KiB |
| 079.txt |
AC |
38 ms |
13696 KiB |
| 080.txt |
AC |
39 ms |
13632 KiB |
| 081.txt |
AC |
38 ms |
13780 KiB |
| 082.txt |
AC |
40 ms |
13624 KiB |
| 083.txt |
AC |
40 ms |
13628 KiB |
| 084.txt |
AC |
40 ms |
13744 KiB |
| 085.txt |
AC |
41 ms |
13636 KiB |
| 086.txt |
AC |
38 ms |
13616 KiB |
| 087.txt |
AC |
39 ms |
13636 KiB |
| 088.txt |
AC |
40 ms |
13724 KiB |
| 089.txt |
AC |
41 ms |
13584 KiB |
| 090.txt |
AC |
95 ms |
14044 KiB |
| 091.txt |
AC |
126 ms |
13992 KiB |
| 092.txt |
AC |
123 ms |
14052 KiB |
| 093.txt |
AC |
120 ms |
13940 KiB |
| 094.txt |
AC |
124 ms |
13944 KiB |
| 095.txt |
AC |
126 ms |
14108 KiB |
| 096.txt |
AC |
123 ms |
14180 KiB |
| 097.txt |
AC |
127 ms |
13996 KiB |
| 098.txt |
AC |
119 ms |
14116 KiB |
| 099.txt |
AC |
121 ms |
14108 KiB |
| 100.txt |
AC |
127 ms |
14048 KiB |
| 101.txt |
AC |
125 ms |
14084 KiB |
| 102.txt |
AC |
131 ms |
13936 KiB |
| 103.txt |
AC |
130 ms |
14104 KiB |
| 104.txt |
AC |
127 ms |
14052 KiB |
| 105.txt |
AC |
127 ms |
13996 KiB |
| 106.txt |
AC |
132 ms |
14040 KiB |
| 107.txt |
AC |
130 ms |
13992 KiB |
| 108.txt |
AC |
130 ms |
13936 KiB |
| 109.txt |
AC |
128 ms |
13956 KiB |
| 110.txt |
AC |
130 ms |
13936 KiB |
| 111.txt |
AC |
133 ms |
13928 KiB |
| 112.txt |
AC |
126 ms |
14168 KiB |
| 113.txt |
AC |
128 ms |
13960 KiB |
| 114.txt |
AC |
130 ms |
14084 KiB |
| 115.txt |
AC |
127 ms |
14176 KiB |
| 116.txt |
AC |
130 ms |
13940 KiB |
| 117.txt |
AC |
127 ms |
14176 KiB |
| 118.txt |
AC |
130 ms |
14152 KiB |
| 119.txt |
AC |
123 ms |
13936 KiB |
| 120.txt |
AC |
135 ms |
13980 KiB |
| 121.txt |
AC |
129 ms |
14048 KiB |
| 122.txt |
AC |
133 ms |
14152 KiB |
| 123.txt |
AC |
129 ms |
13936 KiB |
| 124.txt |
AC |
132 ms |
14108 KiB |
| 125.txt |
AC |
132 ms |
13940 KiB |
| 126.txt |
AC |
126 ms |
14048 KiB |
| 127.txt |
AC |
130 ms |
14108 KiB |
| 128.txt |
AC |
134 ms |
13936 KiB |
| 129.txt |
AC |
128 ms |
14040 KiB |
| 130.txt |
AC |
134 ms |
14040 KiB |
| 131.txt |
AC |
128 ms |
14172 KiB |
| 132.txt |
AC |
126 ms |
13988 KiB |
| 133.txt |
AC |
132 ms |
14100 KiB |
| 134.txt |
AC |
130 ms |
13940 KiB |
| 135.txt |
AC |
130 ms |
13936 KiB |
| 136.txt |
AC |
129 ms |
14172 KiB |
| 137.txt |
AC |
129 ms |
13988 KiB |
| 138.txt |
AC |
128 ms |
14044 KiB |
| 139.txt |
AC |
131 ms |
14116 KiB |