Submission #572021

#TimeUsernameProblemLanguageResultExecution timeMemory
5720218e7Broken Device 2 (JOI22_device2)C++17
0 / 100
1 ms612 KiB
//Challenge: Accepted #include "Anna.h" #include <bits/stdc++.h> using namespace std; namespace { #ifdef zisk void debug(){cout << endl;} template<class T, class ... U> void debug(T a, U ...b){cout << a << " ", debug(b...);} template<class T> void pary(T l, T r) { while (l != r) cout << *l << " ", l++; cout << endl; } #else #define debug(...) 0 #define pary(...) 0 #endif #define ll long long #define maxn 2005 #define pii pair<int, int> #define ff first #define ss second int sum[maxn]; } int Declare() { for (int i = 2;i < maxn;i++) { sum[i] = sum[i-1] + 4*(i * 2 - 3); } return 2000; } std::pair<std::vector<int>, std::vector<int> > Anna(long long A) { int len = 0; while (A > sum[len+1]) len++; vector<int> X(len+1, 0); vector<int> Y(len+1, 0); A -= sum[len]; A--; int p = A / (2*(len-1)+1); if (p & 1) X[0] = 1, Y[0] = 1; if (p & 2) X[len] = 1, Y[len] = 1; A %= 2*len - 1; debug(A, p); for (int i = 1;i < min(len, int(A+1));i++) X[i] = 1; for (int i = 1;i < min(len, int(A - (len-1)+1));i++) Y[i] = 1; pary(X.begin(), X.end()); pary(Y.begin(), Y.end()); return make_pair(X, Y); }
//Challenge: Accepted #include "Bruno.h" #include <bits/stdc++.h> using namespace std; #ifdef zisk void debug(){cout << endl;} template<class T, class ... U> void debug(T a, U ...b){cout << a << " ", debug(b...);} template<class T> void pary(T l, T r) { while (l != r) cout << *l << " ", l++; cout << endl; } #else #define debug(...) 0 #define pary(...) 0 #endif #define ll long long #define maxn 2005 #define pii pair<int, int> #define ff first #define ss second namespace { bool ini = 0; int sum[maxn]; } long long Bruno(std::vector<int> u) { if (!ini) { ini = 1; for (int i = 2;i < maxn;i++) { sum[i] = sum[i-1] + 4*(i * 2 - 3); } } int len = u.size() / 2; int ret = sum[len-1]+1; if (u[0]) ret += (len-3); if (u.back()) ret += 2*(len-1)-2; for (int i = 0;i < 2*len;i++) { if (u[i] == 1) ret++; } debug(ret); return ret; }

Compilation message (stderr)

Anna.cpp: In function 'std::pair<std::vector<int>, std::vector<int> > Anna(long long int)':
Anna.cpp:16:20: warning: statement has no effect [-Wunused-value]
   16 | #define debug(...) 0
      |                    ^
Anna.cpp:45:2: note: in expansion of macro 'debug'
   45 |  debug(A, p);
      |  ^~~~~
Anna.cpp:17:19: warning: statement has no effect [-Wunused-value]
   17 | #define pary(...) 0
      |                   ^
Anna.cpp:49:2: note: in expansion of macro 'pary'
   49 |  pary(X.begin(), X.end());
      |  ^~~~
Anna.cpp:17:19: warning: statement has no effect [-Wunused-value]
   17 | #define pary(...) 0
      |                   ^
Anna.cpp:50:2: note: in expansion of macro 'pary'
   50 |  pary(Y.begin(), Y.end());
      |  ^~~~

Bruno.cpp: In function 'long long int Bruno(std::vector<int>)':
Bruno.cpp:13:20: warning: statement has no effect [-Wunused-value]
   13 | #define debug(...) 0
      |                    ^
Bruno.cpp:42:2: note: in expansion of macro 'debug'
   42 |  debug(ret);
      |  ^~~~~
#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...