Submission #496198

#TimeUsernameProblemLanguageResultExecution timeMemory
496198minhcoolAncient Machine (JOI21_ancient_machine)C++17
Compilation error
0 ms0 KiB
#include<Anna.h> #include<bits/stdc++.h> using namespace std; //#define int long long #define fi first #define se second #define pb push_back #define mp make_pair #define foru(i, l, r) for(int i = l; i <= r; i++) #define ford(i, r, l) for(int i = r; i >= l; i--) typedef pair<int, int> ii; typedef pair<ii, int> iii; typedef pair<ii, ii> iiii; const int oo = 1e18 + 7, mod = 1e9 + 7; void Anna(int n, vector<char> S){ int need = 0; for(auto it : S){ if((it - 'X') == need){ Send(1); need = (need + 1) % 3; } } } /* void process(){ } signed main(){ ios_base::sync_with_stdio(0); process(); }*/
#include<bits/stdc++.h> //#include<Bruno.h> using namespace std; //#define int long long #define fi first #define se second #define pb push_back #define mp make_pair #define foru(i, l, r) for(int i = l; i <= r; i++) #define ford(i, r, l) for(int i = r; i >= l; i--) typedef pair<int, int> ii; typedef pair<ii, int> iii; typedef pair<ii, ii> iiii; const int N = 1e5 + 5; const int oo = 1e18 + 7, mod = 1e9 + 7; void Bruno(int N, int L, vector<int> a){ assert(L == N); vector<int> not_rev; for(int i = 0; i < n; i++){ if(a[i] == 1) not_rev.pb(i); else Remove(i); } for(int i = 1; i < not_rev.size(); i += 3){ Remove(not_rev[i]); } for(int i = 0; i < not_rev.size(); i++){ if((i % 3) != 1) Remove(not_rev[i]); } } /* void process(){ } signed main(){ ios_base::sync_with_stdio(0); process(); }*/

Compilation message (stderr)

Anna.cpp:17:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   17 | const int oo = 1e18 + 7, mod = 1e9 + 7;
      |                ~~~~~^~~

Bruno.cpp:19:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   19 | const int oo = 1e18 + 7, mod = 1e9 + 7;
      |                ~~~~~^~~
Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:24:21: error: 'n' was not declared in this scope
   24 |  for(int i = 0; i < n; i++){
      |                     ^
Bruno.cpp:26:8: error: 'Remove' was not declared in this scope; did you mean 'remove'?
   26 |   else Remove(i);
      |        ^~~~~~
      |        remove
Bruno.cpp:28:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |  for(int i = 1; i < not_rev.size(); i += 3){
      |                 ~~^~~~~~~~~~~~~~~~
Bruno.cpp:29:3: error: 'Remove' was not declared in this scope; did you mean 'remove'?
   29 |   Remove(not_rev[i]);
      |   ^~~~~~
      |   remove
Bruno.cpp:31:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |  for(int i = 0; i < not_rev.size(); i++){
      |                 ~~^~~~~~~~~~~~~~~~
Bruno.cpp:32:20: error: 'Remove' was not declared in this scope; did you mean 'remove'?
   32 |   if((i % 3) != 1) Remove(not_rev[i]);
      |                    ^~~~~~
      |                    remove