Submission #1220598

#TimeUsernameProblemLanguageResultExecution timeMemory
1220598durdonaRack (eJOI19_rack)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using ull = unsigned long long; const int mod = 1e9 + 7; int power(int a, int b){ if(b == 0) return 1; if(b == 1) return a % mod; if(b % 2 == 0){ int y = power(a, b / 2); return y * y % mod; }else return power(a, b - 1) * a % mod; } void solve() { int n, k; cin >> n >> k; auto rec = [&](auto&& rec, int i, int j) -> int{ if(i == 1) return 1; if(j % 2) return rec(rec, i - 1, j / 2 + 1); else return (rec(rec, i - 1, j / 2) + power(2, i - 1)) % mod; }; cout << rec(rec, n, k); } signed main() { cin.tie(nullptr)->sync_with_stdio(false); int t = 1; //cin >> t; while(t--){ solve(); cout << endl; } return 0; }

Compilation message (stderr)

rack.cpp: In function 'void solve()':
rack.cpp:15:13: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   15 |   int n, k; cin >> n >> k;
      |             ^~~
      |             std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:75,
                 from rack.cpp:1:
/usr/include/c++/11/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;           /// Linked to standard input
      |                  ^~~
rack.cpp:22:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |   cout << rec(rec, n, k);
      |   ^~~~
      |   std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:75,
                 from rack.cpp:1:
/usr/include/c++/11/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
rack.cpp: In function 'int main()':
rack.cpp:27:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   27 |   cin.tie(nullptr)->sync_with_stdio(false);
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:75,
                 from rack.cpp:1:
/usr/include/c++/11/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;           /// Linked to standard input
      |                  ^~~
rack.cpp:31:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   31 |     cout << endl;
      |     ^~~~
      |     std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:75,
                 from rack.cpp:1:
/usr/include/c++/11/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
rack.cpp:31:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   31 |     cout << endl;
      |             ^~~~
      |             std::endl
In file included from /usr/include/c++/11/istream:39,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from rack.cpp:1:
/usr/include/c++/11/ostream:684:5: note: 'std::endl' declared here
  684 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~