답안 #816375

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
816375 2023-08-09T04:56:22 Z blackyuki 레지스터 (IOI21_registers) C++17
64 / 100
2 ms 628 KB
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<bool> vb;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define REP(i,k,n) for(ll i=(ll)(k);i<(ll)(n);i++)
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define pb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
const ll inf=1001001001001001001;

void construct_instructions(int s, int n, int k, int q) {
	rep(j,2){
		vector<bool> v;
		rep(i,2000){
			if(i/k%2==j)v.pb(1);
			else v.pb(0);
		}
		append_store(99-j,v);
	}
	rep(j,4){
		vector<bool> v;
		rep(i,2000){
			if(k-i%k-1>=(1<<j))v.pb(1);
			else v.pb(0);
		}
		append_store(97-j,v);
	}
	{
		vector<bool> v;
		rep(i,2000){
			if(i%k==0)v.pb(1);
			else v.pb(0);
		}
		append_store(93,v);
	}
	append_left(0,0,k);
	{
		vector<bool> v;
		rep(i,2000){
			if(i>=(n+1)*k)v.pb(1);
			else v.pb(0);
		}
		append_store(92,v);
	}
	append_or(0,0,92);
	// return;
	rep(c,n){
		if(c==50)append_or(0,0,92);
		append_left(1,0,k);
		append_and(1,1,99-c%2);
		append_right(2,0,k);
		append_and(2,2,98+c%2);
		append_or(1,1,2);
		append_xor(2,0,1);
		{
			append_right(3,2,1);
			append_and(3,3,97);
		}
		rep(i,4){
			append_right(4,3,1<<i);
			append_and(4,4,97-i);
			append_or(3,3,4);
		}
		append_add(3,3,93);
		append_and(3,0,3);
		rep(i,4){
			append_right(4,3,1<<i);
			append_and(4,4,97-i);
			append_or(3,3,4);
		}
		append_and(2,2,3);
		append_and(3,0,98+c%2);
		append_and(4,1,99-c%2);
		append_or(3,3,4);
		append_xor(0,2,3);
	}
	append_right(0,0,k);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 2 ms 628 KB Output is correct
3 Correct 2 ms 628 KB Output is correct
4 Correct 2 ms 628 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 300 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 300 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 2 ms 588 KB Output is correct
4 Correct 2 ms 628 KB Output is correct
5 Correct 2 ms 596 KB Output is correct
6 Correct 2 ms 616 KB Output is correct
7 Correct 1 ms 596 KB Output is correct