제출 #1319079

#제출 시각아이디문제언어결과실행 시간메모리
1319079muhammad-ahmadHidden Sequence (info1cup18_hidden)C++20
컴파일 에러
0 ms0 KiB
#include "grader.h" #include <bits/stdc++.h> #include <iostream> #include <cmath> #include <algorithm> #include <map> #include <vector> #include <iomanip> #include <string> #include <queue> #include <set> #include <deque> #include <numeric> #include <stack> #include <chrono> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; void fast_io() { // freopen("", "r", stdin); // freopen("", "w", stdout); // ios::sync_with_stdio(0); // cin.tie(); // cout.tie(); cout << setprecision(9); } #define int long long // #define endl '\n' #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define fi first #define se second #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> vector<int> findSequence (int n){ vector<int> s; s.push_back(0); bool x = isSubsequence(s); if (!x) s[0] = 1; for (int I = 1; i < n; i++){ int N = s.size(); for (int i = 0; i <= N; i++){ vector<int> t; for (int j = 0; j < i; j++){ t.push_back(s[j]); } t.push_back(0); for (int j = i; j < N; j++){ t.push_back(s[j]); } x = isSubsequence(t); if (x){ swap(t, s); break; } } if (s.size() > I) continue; for (int i = 0; i <= N; i++){ vector<int> t; for (int j = 0; j < i; j++){ t.push_back(s[j]); } t.push_back(1); for (int j = i; j < N; j++){ t.push_back(s[j]); } x = isSubsequence(t); if (x){ swap(t, s); break; } } } } // // void solve() { // // } // // signed main() { // fast_io(); // srand(chrono::steady_clock::now().time_since_epoch().count()); // int tc = 1; // cin >> tc; // while (tc--) solve(); // return 0; // }

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

hidden.cpp: In function 'std::vector<long long int> findSequence(long long int)':
hidden.cpp:42:32: error: could not convert 's' from 'vector<long long int>' to 'vector<int>'
   42 |         bool x = isSubsequence(s);
      |                                ^
      |                                |
      |                                vector<long long int>
hidden.cpp:44:25: error: 'i' was not declared in this scope
   44 |         for (int I = 1; i < n; i++){
      |                         ^
hidden.cpp:55:43: error: could not convert 't' from 'vector<long long int>' to 'vector<int>'
   55 |                         x = isSubsequence(t);
      |                                           ^
      |                                           |
      |                                           vector<long long int>
hidden.cpp:71:43: error: could not convert 't' from 'vector<long long int>' to 'vector<int>'
   71 |                         x = isSubsequence(t);
      |                                           ^
      |                                           |
      |                                           vector<long long int>
hidden.cpp:78:1: warning: no return statement in function returning non-void [-Wreturn-type]
   78 | }
      | ^
grader.cpp: In function 'int main()':
grader.cpp:28:26: warning: format '%d' expects argument of type 'int', but argument 3 has type 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wformat=]
   28 |     fprintf (fifo_out, "%d\n", ans.size ());
      |                         ~^     ~~~~~~~~~~~
      |                          |              |
      |                          int            std::vector<int>::size_type {aka long unsigned int}
      |                         %ld