답안 #711713

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
711713 2023-03-17T11:32:22 Z becaido Popcount (COCI19_popcount) C++17
0 / 110
1 ms 212 KB
#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();
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Wrong command format.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Wrong command format.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Accepted.
2 Incorrect 1 ms 212 KB Wrong command format.
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Wrong command format.
2 Halted 0 ms 0 KB -