Submission #142628

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1426282019-08-10 06:46:27DrumpfTheGodEmperorSnake Escaping (JOI18_snake_escaping)C++14
75 / 100
2023 ms39504 KiB
#include <bits/stdc++.h>
#define bp __builtin_popcountll
#define pb push_back
#define in(s) freopen(s, "r", stdin);
#define out(s) freopen(s, "w", stdout);
#define inout(s, end1, end2) freopen((string(s) + "." + end1).c_str(), "r", stdin),\
freopen((string(s) + "." + end2).c_str(), "w", stdout);
#define fi first
#define se second
#define bw(i, r, l) for (int i = r - 1; i >= l; i--)
#define fw(i, l, r) for (int i = l; i < r; i++)
#define fa(i, x) for (auto i: x)
using namespace std;
const int mod = 1e9 + 7, inf = 1061109567;
const long long infll = 4557430888798830399;
const int L = (1 << 20) + 5;
int l, q, cost[L], defMask = 0, sumSubset[L], sumSubsetOf[L];
int getMask(vector<int> &pos, int replaceMask) {
int ansMask = defMask;
fw (i, 0, pos.size()) {
int bitID = pos[i];
int bit = ((replaceMask >> i) & 1);
ansMask |= (bit << bitID);
}
return ansMask;
}
signed main() {
#ifdef BLU
in("blu.inp");
#endif
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

snake_escaping.cpp: In function 'int getMask(std::vector<int>&, int)':
snake_escaping.cpp:11:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define fw(i, l, r) for (int i = l; i < r; i++)
snake_escaping.cpp:20:6:
  fw (i, 0, pos.size()) {
      ~~~~~~~~~~~~~~~~                  
snake_escaping.cpp:20:2: note: in expansion of macro 'fw'
  fw (i, 0, pos.size()) {
  ^~
snake_escaping.cpp: In function 'int main()':
snake_escaping.cpp:11:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define fw(i, l, r) for (int i = l; i < r; i++)
snake_escaping.cpp:54:7:
   fw (i, 0, t.length()) {
       ~~~~~~~~~~~~~~~~                 
snake_escaping.cpp:54:3: note: in expansion of macro 'fw'
   fw (i, 0, t.length()) {
   ^~
snake_escaping.cpp:11:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define fw(i, l, r) for (int i = l; i < r; i++)
snake_escaping.cpp:64:8:
    fw (i, 0, t.length()) {
        ~~~~~~~~~~~~~~~~                
snake_escaping.cpp:64:4: note: in expansion of macro 'fw'
    fw (i, 0, t.length()) {
    ^~
snake_escaping.cpp:11:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define fw(i, l, r) for (int i = l; i < r; i++)
snake_escaping.cpp:73:8:
    fw (i, 0, t.length()) {
        ~~~~~~~~~~~~~~~~                
snake_escaping.cpp:73:4: note: in expansion of macro 'fw'
    fw (i, 0, t.length()) {
    ^~
snake_escaping.cpp:11:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define fw(i, l, r) for (int i = l; i < r; i++)
snake_escaping.cpp:87:8:
    fw (i, 0, t.length()) {
        ~~~~~~~~~~~~~~~~                
snake_escaping.cpp:87:4: note: in expansion of macro 'fw'
    fw (i, 0, t.length()) {
    ^~
#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...