結果

問題 No.1589 Bit Vector
ユーザー momoyuu
提出日時 2024-08-08 16:26:56
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 727 bytes
コンパイル時間 1,144 ms
コンパイル使用メモリ 91,856 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-08-08 16:27:05
合計ジャッジ時間 8,587 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 2 WA * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
using ll = long long;

void and1(int i,int j,int k){
    cout<<"AND "<<i<<" "<<j<<" "<<k<<endl;
}
void xor1(int i,int j,int k){
    cout<<"XOR "<<i<<" "<<j<<" "<<k<<endl;
}
void upd(int i,int x){
    cout<<"UPD "<<i<<" "<<x<<endl;
}
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int n,k;
    cin>>n>>k;
    for(int i = n-1;i>0;i--){
        for(int j = i;j>0;j--){
            int ni = j-1;
            int nj = j;
            xor1(n,ni,nj);
            xor1(nj,n,nj);
            xor1(ni,ni,nj);
            and1(n,nj,n);
            xor1(nj,nj,n);
        }
    }
    upd(n,1);
    for(int i = 0;i<k;i++) and1(n,i,n);
}

0