Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
- #define FOR(i,a,b) for(int i = (a); i < (b); i++)
- #define rep(i,n) FOR(i,0,n)
- #define RFOR(i,b,a) for(int i = (b) - 1; i>= (a); i--)
- #define ITER(it, a) for(typeof(a.begin()) it = a.begin(); it != a.end(); it++)
- #define FILL(a, value) memset(a, value, sizeof(a)
- #define SZ(a) (int)a.size()
- #define ALL(a) a.begin(), a.end()
- #define PB emplace_back
- #define MP make_pair
- #define in insert
- #define sc second
- #define fs first
- #define er erase
- typedef long long LL;
- typedef vector<int> VI;
- typedef vector<LL>VL;
- typedef vector<bool>VB;
- typedef pair<int,int> PII;
- const double PI = acos(-1.0);
- const int INF = 1000 * 1000 * 1000 + 7;
- const LL LINF = INF * (LL) INF;
- const double EPS = 1e-7;
- const int MAX = 20 * 1000 + 47;
- const int MAS = int(1e6+1);
- const int MOD = int(1e9 + 7 );
- int main ()
- {
- int n;
- cin >> n ;
- int mx = 0 ,res;
- rep(msk,1<<11)
- {
- bool ok = true;
- int cnt = 0;
- rep(i,11)
- {
- if(msk &(1<< i))
- {
- cnt++ ;
- int x = (i+4) %11;
- if(msk & (1 << x))ok = false ;
- x = (i+7)%11 ;
- if(msk &(1 << x))ok = false ;
- }
- }
- if(ok)
- {
- int ans = (n/11) * cnt ;
- rep(i,n%11)
- {
- if(msk & (1 << i ))
- {
- ans++;
- }
- }
- if (mx < ans)
- {
- mx = ans;
- res = msk ;
- }
- }
- }
- cout << mx << endl ;
- rep(i,n)
- {
- if(res & (1 << (i%11))){
- cout << i+1 << " " ;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement