제출 #934819

#제출 시각아이디문제언어결과실행 시간메모리
934819nguyentunglamBroken Device 2 (JOI22_device2)C++17
0 / 100
55 ms4380 KiB
#include "Anna.h" #include <utility> #include <vector> #include <bits/stdc++.h> using namespace std; namespace { int x = 0; } int Declare() { return 180; } std::pair<std::vector<int>, std::vector<int> > Anna(long long A) { int m = log2(A) + 1; vector<int> s, t; for(int i = 0; i < m; i++) { s.push_back(A >> i & 1); s.push_back(A >> i & 1); s.push_back(A >> i & 1); } for(int i = 0, cur = 0; i < 3 * m; i++) { t.push_back(cur ^= 1); } for(int &j : s) cout << j; cout << endl; for(int &j : t) cout << j; cout << endl; return make_pair(s, t); }
#include "Bruno.h" #include <utility> #include <vector> #include <bits/stdc++.h> using namespace std; namespace { int variable_example = 0; } long long Bruno(std::vector<int> u) { vector<int> bit; int real_sum = 0, fake_sum = 0; for(int &j : u) { if (j == 0) fake_sum--; else fake_sum++; if (fake_sum > real_sum + 2) { real_sum += 3; bit.push_back(1); } if (fake_sum < real_sum - 1) { real_sum -= 3; bit.push_back(0); } // cout << real_sum << " " << fake_sum << " " << j << endl; } // for(int &j : u) cout << j; cout << endl; // for(int &j : bit) cout << j; cout << endl; long long ans = 0; for(int j = 0; j < bit.size(); j++) if (bit[j]) ans |= (1 << j); // cout << ans << endl; return ans; }

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

Anna.cpp: In function 'std::pair<std::vector<int>, std::vector<int> > Anna(long long int)':
Anna.cpp:29:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   29 |   for(int &j : s) cout << j; cout << endl;
      |   ^~~
Anna.cpp:29:30: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   29 |   for(int &j : s) cout << j; cout << endl;
      |                              ^~~~
Anna.cpp:30:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   30 |   for(int &j : t) cout << j; cout << endl;
      |   ^~~
Anna.cpp:30:30: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   30 |   for(int &j : t) cout << j; cout << endl;
      |                              ^~~~
Anna.cpp: At global scope:
Anna.cpp:9:5: warning: '{anonymous}::x' defined but not used [-Wunused-variable]
    9 | int x = 0;
      |     ^

Bruno.cpp: In function 'long long int Bruno(std::vector<int>)':
Bruno.cpp:33:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |   for(int j = 0; j < bit.size(); j++) if (bit[j]) ans |= (1 << j);
      |                  ~~^~~~~~~~~~~~
Bruno.cpp: At global scope:
Bruno.cpp:9:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    9 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
#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...