結果

問題 No.1589 Bit Vector
ユーザー 沙耶花沙耶花
提出日時 2021-07-02 11:39:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,059 bytes
コンパイル時間 4,430 ms
コンパイル使用メモリ 264,684 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-09-14 04:55:02
合計ジャッジ時間 10,376 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 1 ms
4,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
4,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 2 ms
4,380 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 13 ms
4,376 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 14 ms
4,376 KB
testcase_35 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001

int N,K,T;

vector<string> s;
vector<int> a,b,c;

void UPD(int i,int x){
	s.push_back("UPD ");
	a.push_back(i);
	b.push_back(x);
	c.push_back(-1);
}

void AND(int i,int j,int k){
	s.push_back("AND ");
	a.push_back(i);
	b.push_back(j);
	c.push_back(k);
}

void XOR(int i,int j,int k){
	s.push_back("XOR ");
	a.push_back(i);
	b.push_back(j);
	c.push_back(k);
}

int main(){
	
	
	cin>>N>>K>>T;
	
	vector<vector<int>> C(T,vector<int>(N));
	rep(i,T){
		rep(j,N){
			cin>>C[i][j];
		}
	}
	
	rep(i,N){
		if(i==0)continue;
		int r = i;
		int l = i-1;
		while(l>=0){
			XOR(l,l,r);
			UPD(N,0);
			XOR(N,r,N);
			AND(r,l,r);
			XOR(r,r,N);
			XOR(l,l,r);
			l--;
		}
		
	}
	
	UPD(N,0);
	XOR(N,N,K-1);
	
	cout<<s.size()<<endl;
	rep(i,s.size()){
		cout<<s[i]<<a[i]<<' '<<b[i];
		if(s[i]!="UPD "){
			cout<<' '<<c[i];
		}
		cout<<endl;
	}
	
    return 0;
}
0