#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
#define ll long long
// #define int ll
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, n+1)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
#define pii pair<int, int>
#define pip pair<int, pii>
#define f first
#define s second
#define pb push_back
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)((x).size())
#ifdef TOAD
#define IOS() ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#else
#define IOS() ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#endif // TOAD
const ll maxn = 1e3+5;
const int iinf = 1e9+5;
bool is_sub(string a, string b){
int ptr = 0;
REP(i, SZ(b)){
bool fnd = 0;
while(ptr < SZ(a)){
if (a[ptr] == b[i]){
fnd = 1;
ptr++;
break;
}
ptr++;
}
if (!fnd) return 0;
}
return 1;
}
string conv(int a, int nm){
string ret;
REP(i, nm){
if (a & (1<<i)) ret += '1';
else ret += '0';
}
return ret;
}
vector<int> findSequence(int n){
vector<int> blac;
blac.pb(1);
while(SZ(blac) <= n && isSubsequence(blac)){
blac.pb(1);
}
blac.pop_back();
int m = n - SZ(blac);
if (m == 0) return blac;
vector<int> ret;
REP(i, SZ(blac)+1){
vector<int> tmp;
vector<int> wh;
for (int ppp = 1;; ppp++){
tmp.clear();
for (auto x:ret) tmp.pb(x);
REP(j, ppp) tmp.pb(0);
FOR(j, i, SZ(blac)) tmp.pb(1);
if (SZ(tmp) > n) break;
if (isSubsequence(tmp)){
wh.pb(0);
}
}
REP(j, SZ(wh)) ret.pb(0);
if (i != SZ(blac)) ret.pb(1);
}
return ret;
//cout<<mn<<endl;
//for (auto pp:ret) cout<<pp<<endl;
}
/*
signed main(){
IOS();
int n; cin>>n;
}
*/
/*
2 3
2 4 3
5 7 5
*/
컴파일 시 표준 에러 (stderr) 메시지
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
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |