# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
962 | tncks0121 | 보도블록 (KOI11_block) | C++98 | 4 ms | 1088 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
int H,W;
int main(){
scanf("%d%d",&H,&W);
int x,y,c;
printf("%d",2*H*W);
if(H%2==0){
x=1; y=2; c=0;
printf("\n1 1 1\n1 1 0");
for(;x!=1||y!=1;){
printf("\n%d %d %d",x,y,c);
if(x==H){
if(c==y%2)c=1-y%2;
else{
if(y==1)x--,y=1,c=1;
else y--,c=y%2;
}
}else if(y==1){
if(c)c=0;
else{
x--; c=1;
}
}else if(x%2==1){
if(!c)c=1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |