제출 #770368

#제출 시각아이디문제언어결과실행 시간메모리
770368PlurmFlights (JOI22_flights)C++17
0 / 100
19 ms928 KiB
#include "Ali.h" #include <string> #include <vector> using namespace std; namespace { const int MODX = 1024; const int MODY = 1024; int N; vector<int> g[10005]; } // namespace int dist(int u, int v, int p = -1) { int mn = 1e9; if (u == v) return 0; for (int w : g[u]) { if (w == p) continue; mn = min(mn, dist(w, v, u) + 1); } return mn; } void Init(int N, std::vector<int> U, std::vector<int> V) { ::N = N; for (int i = 0; i < N; i++) SetID(i, i); for (int i = 0; i < 10005; i++) g[i].clear(); for (int i = 0; i < N - 1; i++) { g[U[i]].push_back(V[i]); g[V[i]].push_back(U[i]); } } std::string SendA(std::string S) { int mx = 0; int my = 0; for (int i = 0; i < 10; i++) { if (S[i] == '1') mx |= 1 << i; } for (int i = 0; i < 10; i++) { if (S[10 + i] == '1') my |= 1 << i; } std::string out; for (int i = 0; i < N; i++) { if (i % MODX == mx) { for (int j = 0; j < N; j++) { if (j % MODY == my) { int d = dist(i, j); for (int b = 0; b < 14; b++) { if (d & (1 << b)) out.push_back('1'); else out.push_back('0'); } } } } } return out; }
#include "Benjamin.h" #include <string> #include <vector> using namespace std; namespace { const int MODX = 1024; const int MODY = 1024; int N, X, Y; } // namespace std::string SendB(int N, int X, int Y) { ::N = N; ::X = X; ::Y = Y; int mx = X % MODX; int my = Y % MODY; std::string msg; for (int i = 0; i < 10; i++) { if (mx & (1 << i)) msg.push_back('1'); else msg.push_back('0'); } for (int i = 0; i < 10; i++) { if (my & (1 << i)) msg.push_back('1'); else msg.push_back('0'); } return msg; } int Answer(std::string T) { int mx = X % MODX; int my = Y % MODY; int c = 0; for (int i = 0; i < N; i++) if (i % MODY == my) c++; int idx = X / MODX * c + Y / MODY; int d = 0; for (int i = 0; i < 14; i++) { if (T[idx + i] == '1') d |= 1 << i; } return d; }

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

grader_ali.cpp:10:8: warning: '{anonymous}::_randmem' defined but not used [-Wunused-variable]
   10 |   char _randmem[12379];
      |        ^~~~~~~~

Benjamin.cpp: In function 'int Answer(std::string)':
Benjamin.cpp:37:9: warning: unused variable 'mx' [-Wunused-variable]
   37 |     int mx = X % MODX;
      |         ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...