This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,popcnt,sse4,abm")
#include <bits/stdc++.h>
using namespace std;
#ifdef WAIMAI
#define debug(HEHE...) cout << "[" << #HEHE << "] : ", dout(HEHE)
void dout() {cout << '\n';}
template<typename T, typename...U>
void dout(T t, U...u) {cout << t << (sizeof... (u) ? ", " : ""), dout (u...);}
#else
#define debug(...) 7122
#endif
#define ll long long
#define Waimai ios::sync_with_stdio(false), cin.tie(0)
#define FOR(x,a,b) for (int x = a, I = b; x <= I; x++)
#define pb emplace_back
#define F first
#define S second
const string sum[9] = {"4469269309980865699858008332735282042493121940197464459241187147907254676691182325600624766055634475896677286062162016951251294270648856648811216335361365", "2681561585988519419914804999641169225495873164118478675544712288744352806014709395360374859633380685538006371637297210170750776562389313989286729801216819", "788694584114270417622001470482696831028197989446611375160209496689515531180796880988345546950994319275884226952146238285514934283055680585084332294475535", "52170458871371973150093482483291230068013096578180518979469110675960171323243373450590950576524916061050707619402669458574917831953099493954994743214335", "204583791292591926691396081575382549208529011407180575518006033900266475884974090617542369930984076593222635430161375266700549045759594884514604711935", "3121748549589153507255220667214744133005063442417264435278786581112765113115492710770662312255297115872319494912905282327171554901817584187867135", "726838724295606890509921801691610055143498307623095356558689689527106077364635040561028680485123622079561121241075102686324128571457535", "39402006196394479212279040100143613804963947181228130472524722419237033863644280909115546629308921431406146628878335", "115792089237316195423570985008687907853269984665640564039457584007913129639935"};
int n, k;
void solve() {
cin >> n >> k;
if (n == 1) {
cout << "1\n";
cout << "A=A\n";
return;
}
cout << __lg(n - 1) + 1 << '\n';
for (int len = 1, i = 0; len < n; len <<= 1, i++) {
cout << "A=" << "((A&" << sum[i] << ")+((A>>" << len << ")&" << sum[i] << "))\n";
}
}
int main() {
Waimai;
solve();
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |