結果
| 問題 | No.2545 Divide by 3 | 
| コンテスト | |
| ユーザー |  Nachia | 
| 提出日時 | 2023-11-16 01:02:49 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 1,052 bytes | 
| コンパイル時間 | 863 ms | 
| コンパイル使用メモリ | 81,292 KB | 
| 最終ジャッジ日時 | 2025-02-17 22:13:54 | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 5 | 
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <atcoder/modint>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
#define rep(i,n) for(i64 i=0; i<(i64)(n); i++)
#define repr(i,n) for(i64 i=(i64)(n)-1; i>=0; i--)
const i64 INF = 1001001001001001001;
using Modint = atcoder::static_modint<998244353>;
bool verify(u64 x){
    vector<u64> A(4);
    A[2] = 1;
    A[1] = x;
    u64 mult = 0x2000000001 / 3;
    vector<string> Q;
    rep(d,37){
        if((mult >> d) & 1) A[3] = A[3] + A[1];
        A[1] = A[1] + A[1];
        A[3] /= 2;
        A[1] /= 2;
    }
    return A[3] == x / 3;
}
int main(){
    ios::sync_with_stdio(false); cin.tie(nullptr);
    u64 mult = 0x2000000001 / 3;
    vector<string> Q;
    rep(d,37){
        if((mult >> d) & 1) Q.push_back("plus 3 3 1");
        Q.push_back("plus 1 1 1");
        Q.push_back("div 3 3");
        Q.push_back("div 1 1");
    }
    cout << Q.size() << '\n';
    for(auto& q : Q) cout << q << '\n';
    return 0;
}
            
            
            
        