이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
void construct_instructions(int s, int n, int k, int q) {
int m=100,b=2000;
vector<bool> A(b,0);
for (int i=n*k;i<b;i++) A[i]=1; append_store(99,A); append_or(0,0,99);
int r1=98,r2=97,A0=96,A1=95;
for (int i=0;i<b;i++) if ((i/k)%2==0) A[i]=1; else A[i]=0;
append_store(r1,A);
for (int i=0;i<b;i++) if (i%(k*2)==0) A[i]=1; else A[i]=0;
append_store(r2,A);
int a=1;
while (a<n) {
append_right(1,0,a*k);
a*=2;
append_not(2,1);
append_and(2,2,r1);
append_and(0,0,r1);
append_add(3,0,2);
append_right(3,3,k);
append_and(3,3,r2);
append_add(3,3,r1);
append_and(A0,3,0);
append_not(3,3);
append_and(A1,3,1);
append_or(0,A0,A1);
}
}
컴파일 시 표준 에러 (stderr) 메시지
registers.cpp: In function 'void construct_instructions(int, int, int, int)':
registers.cpp:8:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
8 | for (int i=n*k;i<b;i++) A[i]=1; append_store(99,A); append_or(0,0,99);
| ^~~
registers.cpp:8:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
8 | for (int i=n*k;i<b;i++) A[i]=1; append_store(99,A); append_or(0,0,99);
| ^~~~~~~~~~~~
registers.cpp:6:6: warning: unused variable 'm' [-Wunused-variable]
6 | int m=100,b=2000;
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |