제출 #770390

#제출 시각아이디문제언어결과실행 시간메모리
770390AmylopectinFlights (JOI22_flights)C++17
15 / 100
7 ms2080 KiB
#include "Ali.h" #include <string> #include <vector> #include <stdio.h> using namespace std; const int mxn = 2e4 + 10; vector<int> pa[mxn] = {}; int dis[mxn] = {}; // char ans = {}; string ans; int re(int cn,int be) { int i,j,fn; for(i=0; i<pa[cn].size(); i++) { fn = pa[cn][i]; if(fn == be) { continue; } dis[fn] = dis[cn] + 1; re(fn,cn); } return 0; } void Init(int n, std::vector<int> uu, std::vector<int> vv) { int i,j,cn,cm,fn,fm; for(i=0; i<n; i++) { pa[i].clear(); } for(i=0; i<n-1; i++) { pa[uu[i]].push_back(vv[i]); pa[vv[i]].push_back(uu[i]); } for(i=0; i<n; i++) { SetID(i,i); } return ; } std::string SendA(std::string s) { int i,j,cn,cm,fn,fm; ans.clear(); cn = 0; cm = 0; for(i=0; i<14; i++) { cn += (s[i] - '0') * (1<<i); } for(i=14; i<20; i++) { cm += (s[i] - '0') * (1<<(i-14)); } dis[cn] = 0; re(cn,-1); cm *= 157; for(i=0; i<157; i++) { for(j=0; j<14; j++) { if((1<<j) & dis[cm+i]) { ans.push_back('1'); // ans[i*14+j] = '1'; } else { ans.push_back('0'); // ans[i*14+j] = '0'; } } } return ans; }
#include "Benjamin.h" #include <string> #include <vector> #include <stdio.h> using namespace std; // int const mxn = 2e4 + 10; int n,yyy; string s; // char s[mxn] = {}; std::string SendB(int nn, int x, int yy) { int i,j,cm; s.clear(); for(i=0; i<20; i++) { s.push_back(0); } n = nn; yyy = yy; for(i=0; i<14; i++) { if((1<<i) & x) { s[i] = '1'; } else { s[i] = '0'; } } cm = yyy / 157; for(i=0; i<6; i++) { if((1<<i) & cm) { s[i+14] = '1'; } else { s[i+14] = '0'; } } return s; } int Answer(std::string t) { int i,j,cn,cm,su = 0; cn = yyy % 157; for(i=0; i<14; i++) { su += (1<<i) * (t[cn*14+i] - '0'); } return su; }

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

Ali.cpp: In function 'int re(int, int)':
Ali.cpp:14:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |   for(i=0; i<pa[cn].size(); i++)
      |            ~^~~~~~~~~~~~~~
Ali.cpp:13:9: warning: unused variable 'j' [-Wunused-variable]
   13 |   int i,j,fn;
      |         ^
Ali.cpp: In function 'void Init(int, std::vector<int>, std::vector<int>)':
Ali.cpp:29:9: warning: unused variable 'j' [-Wunused-variable]
   29 |   int i,j,cn,cm,fn,fm;
      |         ^
Ali.cpp:29:11: warning: unused variable 'cn' [-Wunused-variable]
   29 |   int i,j,cn,cm,fn,fm;
      |           ^~
Ali.cpp:29:14: warning: unused variable 'cm' [-Wunused-variable]
   29 |   int i,j,cn,cm,fn,fm;
      |              ^~
Ali.cpp:29:17: warning: unused variable 'fn' [-Wunused-variable]
   29 |   int i,j,cn,cm,fn,fm;
      |                 ^~
Ali.cpp:29:20: warning: unused variable 'fm' [-Wunused-variable]
   29 |   int i,j,cn,cm,fn,fm;
      |                    ^~
Ali.cpp: In function 'std::string SendA(std::string)':
Ali.cpp:48:17: warning: unused variable 'fn' [-Wunused-variable]
   48 |   int i,j,cn,cm,fn,fm;
      |                 ^~
Ali.cpp:48:20: warning: unused variable 'fm' [-Wunused-variable]
   48 |   int i,j,cn,cm,fn,fm;
      |                    ^~
grader_ali.cpp:10:8: warning: '{anonymous}::_randmem' defined but not used [-Wunused-variable]
   10 |   char _randmem[12379];
      |        ^~~~~~~~

Benjamin.cpp: In function 'std::string SendB(int, int, int)':
Benjamin.cpp:12:9: warning: unused variable 'j' [-Wunused-variable]
   12 |   int i,j,cm;
      |         ^
Benjamin.cpp: In function 'int Answer(std::string)':
Benjamin.cpp:48:9: warning: unused variable 'j' [-Wunused-variable]
   48 |   int i,j,cn,cm,su = 0;
      |         ^
Benjamin.cpp:48:14: warning: unused variable 'cm' [-Wunused-variable]
   48 |   int i,j,cn,cm,su = 0;
      |              ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...