• Bio

    Py 的题这么水, 肯定都是一行代码 ac 的 (不包含 ";")

    我的博客

    $ \def\noteh{44pt} \def\notetitlepos{24pt} \def\notetitleh{20pt} \def\noteSetT#1{ \def\notetitle{\textsf{\textbf{#1}}}} \def\noteText#1{ \def\txt{#1}} \def\noteSide#1{ \def\notew{#1}} \def\notetitleoffest{37pt} \def\noteNote{ \def\notech{\kern{-1.5pt}✒\kern{0.5pt}} \noteSetT{注意} \def\notelcol{#448AFF}\def\notetcol{#ECF3FF}} \def\noteAbstract{ \def\notech{\kern{-2pt}\char"d83d\char"ddd2\kern{1.5pt}} \noteSetT{摘要} \def\notelcol{#00B0FF}\def\notetcol{#E5F7FF}} \def\noteInfo{ \def\notech{\kern{2pt}\bf{i}\kern{5.5pt}} \noteSetT{信息} \def\notelcol{#00B8D4}\def\notetcol{#E5F8FB}} \def\noteTip{ \def\notech{\kern{-2pt}\char"d83d\char"dca1} \noteSetT{提示} \def\notelcol{#00BFA5}\def\notetcol{#E5F8F6}} \def\noteOk{ \def\notech{\kern{-2.0pt}\bf{√}\kern{2.4pt}} \noteSetT{示例\kern{-0.5pt}} \def\notelcol{#00C853}\def\notetcol{#E5F9ED}} \def\noteQ{ \def\notech{\kern{0.5pt}\textbf{?}\kern{4.5pt}} \noteSetT{问题} \def\notelcol{#64DD17}\def\notetcol{#EFFCE7}} \def\noteWarn{ \def\notech{\kern{-1pt}⚠\kern{2.8pt}} \noteSetT{警告} \def\notelcol{#FF9100}\def\notetcol{#FFF4E5}} \def\noteFail{ \def\notech{\kern{-2.4pt}\Large\bf{×}\kern{1.6pt}} \noteSetT{失败} \def\notelcol{#FF5252}\def\notetcol{#FFEDED}} \def\noteDanger{ \def\notech{\kern{-5pt}⚡} \noteSetT{危险} \def\notelcol{#FF1744}\def\notetcol{#FFE7EC}} \def\noteBug{ \def\notech{\kern{-4.5pt}\char"d83d\char"dc1e\kern{-0.5pt}} \noteSetT{错误} \def\notelcol{#F50057}\def\notetcol{#FEE5EE}} \def\noteCite{ \def\notech{\kern{1pt}\textbf{"}\kern{3.2pt}} \noteSetT{引述} \def\notelcol{#9E9E9E}\def\notetcol{#F5F5F5}} \noteCite\def\noteinfo{} \def\drawnote{\color{\notelcol}\rule{2pt}{\noteh}\color{\notetcol}\rule[\notetitlepos]{\notew}{\notetitleh}\color{#e8e8e8}\rule{0.5pt}{\noteh}\color{#f5f5f5}\rule{0.5pt}{\noteh}\color{#fafafa}\rule{0.5pt}{\noteh}\kern{-\notew}\kern{-1.5pt}\def\drawx#1#2{\color{#1}\rule[#2]{\notew}{0pt}\kern{-\notew}}\drawx{#bfbfbf}{0pt}\drawx{#d6d6d6}{-0.5pt}\drawx{#ececec}{-1.0pt}\drawx{#f8f8f8}{-1.5pt}\color{black}\raisebox{\notetitlepos}{ \raisebox{6pt}{ \kern{-1pt} \color{\notelcol}\large{\notech} \raisebox{1.5pt}{ \color{#404040}\footnotesize \kern{-2pt}\notetitle } }}\kern{-\notetitleoffest}\raisebox{10pt}{ \footnotesize \sf{\txt}}} \def\build{\drawnote\newline} \noteText{a1与残局皆失} \noteSide{160pt} \noteDanger\build $

    FxxkPy

    .------..------..------..------..------..------.
    |F.--. ||X.--. ||X.--. ||K.--. ||P.--. ||Y.--. |
    | :(): || :/\: || :/\: || :/\: || :/\: || (\/) |
    | ()() || (__) || (__) || :\/: || (__) || :\/: |
    | '--'F|| '--'X|| '--'X|| '--'K|| '--'P|| '--'Y|
    `------'`------'`------'`------'`------'`------'
    

    florr.io

    快速傅里叶变换

    #define _USE_MATH_DEFINES
    
    #include <vector>
    #include <complex>
    #include <math.h>
    
    #define com ::std::complex<long double>
    #define v_com ::std::vector<::std::complex<long double>>
    #define uint unsigned long long int
    
    v_com fft(v_com value, bool inverse);
    
    namespace _fft_build_in_fuction {
        v_com _fft(v_com value, bool inverse);
    
    	v_com _fft(v_com value, bool inverse) {
    		uint size = value.size();
    	    v_com result(size);
    	    if (size == 1) {
    	        result[0] = value[0];
    	        return result;
    	    }
    	    else {
    	        v_com p_o(size / 2);
    	        v_com p_e(size / 2);
    	
    	        for (uint i = 0; i < size / 2; ++i) {
    	            p_o[i] = value[2 * i];
    	            p_e[i] = value[2 * i + 1];
    	        }
    	
    	        auto q_o = _fft(p_o, inverse);
    	        auto q_e = _fft(p_e, inverse);
    	
    	        com ω0(1, 0), ω(cos(2 * M_PI / size), sin(2 * M_PI / size));
    			ω *= inverse ? -1 : 1;
    	        for (uint i = 0; i < size / 2; ++i, ω0 *= ω) {
    	            result[i] = q_o[i] + ω0 * q_e[i];
    	            result[i + size / 2] = q_o[i] - ω0 * q_e[i];
    	        }
    	        return result;
    	    }
    	}
    }
    
    v_com fft(v_com value, bool inverse) {
        auto result = ::_fft_build_in_fuction::_fft(value, inverse);
        uint length = value.size();
        if (inverse) {
            for (auto& item : result) {
                item /= length;
            }
        }
        return result;
    }
    

    测试

    #include <iostream>
    
    using namespace ::std;
    
    void print(v_com value) {
    	for (auto& item : value) {
    		cout << item << " ";
    	}
    	cout << "\n";
    }
    
    int main() {
    //	v_com value{1, 2, 3, 4};
    	v_com value({com(10,0), com(-2,-2), com(-2,0), com(-2,2)});
    	print(value);
    	
    //	auto result = fft(value, false);
    	auto result = fft(value, true);
    	print(result);
    
    	return 0;
    }
    

    帮助

    $ \def\noteh{44pt} \def\notetitlepos{24pt} \def\notetitleh{20pt} \def\noteSetT#1{ \def\notetitle{\textsf{\textbf{#1}}}} \def\noteText#1{ \def\txt{#1}} \def\noteSide#1{ \def\notew{#1}} \def\notetitleoffest{37pt} \def\noteNote{ \def\notech{\kern{-1.5pt}✒\kern{0.5pt}} \noteSetT{注意} \def\notelcol{#448AFF}\def\notetcol{#ECF3FF}} \def\noteAbstract{ \def\notech{\kern{-2pt}\char"d83d\char"ddd2\kern{1.5pt}} \noteSetT{摘要} \def\notelcol{#00B0FF}\def\notetcol{#E5F7FF}} \def\noteInfo{ \def\notech{\kern{2pt}\bf{i}\kern{5.5pt}} \noteSetT{信息} \def\notelcol{#00B8D4}\def\notetcol{#E5F8FB}} \def\noteTip{ \def\notech{\kern{-2pt}\char"d83d\char"dca1} \noteSetT{提示} \def\notelcol{#00BFA5}\def\notetcol{#E5F8F6}} \def\noteOk{ \def\notech{\kern{-2.0pt}\bf{√}\kern{2.4pt}} \noteSetT{示例\kern{-0.5pt}} \def\notelcol{#00C853}\def\notetcol{#E5F9ED}} \def\noteQ{ \def\notech{\kern{0.5pt}\textbf{?}\kern{4.5pt}} \noteSetT{问题} \def\notelcol{#64DD17}\def\notetcol{#EFFCE7}} \def\noteWarn{ \def\notech{\kern{-1pt}⚠\kern{2.8pt}} \noteSetT{警告} \def\notelcol{#FF9100}\def\notetcol{#FFF4E5}} \def\noteFail{ \def\notech{\kern{-2.4pt}\Large\bf{×}\kern{1.6pt}} \noteSetT{失败} \def\notelcol{#FF5252}\def\notetcol{#FFEDED}} \def\noteDanger{ \def\notech{\kern{-5pt}⚡} \noteSetT{危险} \def\notelcol{#FF1744}\def\notetcol{#FFE7EC}} \def\noteBug{ \def\notech{\kern{-4.5pt}\char"d83d\char"dc1e\kern{-0.5pt}} \noteSetT{错误} \def\notelcol{#F50057}\def\notetcol{#FEE5EE}} \def\noteCite{ \def\notech{\kern{1pt}\textbf{"}\kern{3.2pt}} \noteSetT{引述} \def\notelcol{#9E9E9E}\def\notetcol{#F5F5F5}} \noteCite\def\noteinfo{} \def\drawnote{\color{\notelcol}\rule{2pt}{\noteh}\color{\notetcol}\rule[\notetitlepos]{\notew}{\notetitleh}\color{#e8e8e8}\rule{0.5pt}{\noteh}\color{#f5f5f5}\rule{0.5pt}{\noteh}\color{#fafafa}\rule{0.5pt}{\noteh}\kern{-\notew}\kern{-1.5pt}\def\drawx#1#2{\color{#1}\rule[#2]{\notew}{0pt}\kern{-\notew}}\drawx{#bfbfbf}{0pt}\drawx{#d6d6d6}{-0.5pt}\drawx{#ececec}{-1.0pt}\drawx{#f8f8f8}{-1.5pt}\color{black}\raisebox{\notetitlepos}{ \raisebox{6pt}{ \kern{-1pt} \color{\notelcol}\large{\notech} \raisebox{1.5pt}{ \color{#404040}\footnotesize \kern{-2pt}\notetitle } }}\kern{-\notetitleoffest}\raisebox{10pt}{ \footnotesize \sf{\txt}}} \def\build{\drawnote\newline} \noteText{机密文件} \noteSide{160pt} \noteWarn\build $

    下载此文件后将后缀名改为zip即可看到

    六人****集团:@ @ @ @ @ @

  • Recent Activities