2640: More Vertexes, More Area

本文提供了一段C语言代码,用于解决特定的二维矩阵问题。该程序通过输入两个整数来定义矩阵的维度,并根据不同的条件计算并输出特定的结果。

#include<stdio.h>
int main()
{
 int temp,m,n,s;
  while(scanf("%d%d",&m,&n)!=EOF)
  {
  if(m==0&&n==0) break;
  if(m==1||n==1) printf("0/n");
     else
  if(m==2||n==2)
  {
   if(n!=2) printf("%d/n",n-1);
   if(m!=2) printf("%d/n",m-1);
   if(m==2&&n==2) printf("1/n");
  }
  else
  if(m%2==0||n%2==0)
  {
           if(m%2==0&&n%2==0)
     {
      if(m<n)
      {
       temp=m;
       m=n;
       n=temp;
      }
      s=(m-1)*(n-1)-(m/2-1)*(n-2);
     }
     else
     if(m%2==0) s=(m-1)*(n-1)-(m/2-1)*(n-2);
     else
     s=(m-1)*(n-1)-(n/2-1)*(m-2);
       printf("%d/n",s);
  }
  else
  {
      if(m<n)
      {
       temp=m;
       m=n;
       n=temp;
      }
      s=(m-1)*(n-1)-((m-1)/2)*(n-2)+(n-1)/2;
        printf("%d/n",s);
  }
 }
  return 0;
}

[root@localhost nocodb-project]# docker-compose up -d --build WARN[0000] /usr/local/bin/nocodb-project/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion [+] Building 0.0s (0/0) { "vertexes": [ { "digest": "sha256:b7a3e1705f9d67eefbb40ef26314b9439bf1c654646049863a468a7bdd640a4b", "name": "[internal] load local bake definitions", "started": "2025-11-14T12:01:16.508782743+08:00" } ] } { "statuses": [ { "id": "reading from stdin", "vertex": "sha256:b7a3e1705f9d67eefbb40ef26314b9439bf1c654646049863a468a7bdd640a4b", "current": 0, "timestamp": "0001-01-01T00:00:00Z", "started": "2025-11-14T12:01:16.508786803+08:00" } ] } { "statuses": [ { "id": "reading from stdin", "vertex": "sha256:b7a3e1705f9d67eefbb40ef26314b9439bf1c654646049863a468a7bdd640a4b", "current": 368, "timestamp": "0001-01-01T00:00:00Z", "started": "2025-11-14T12:01:16.508786803+08:00", "completed": "2025-11-14T12:01:16.509903134+08:00" } ] } { "statuses": [ { "id": "reading from stdin", "vertex": "sha256:b7a3e1705f9d67eefbb40ef26314b9439bf1c654646049863a468a7bdd640a4b", "current": 368, "timestamp": "0001-01-01T00:00:00Z", "started": "2025-11-14T12:01:16.508786803+08:00", "completed": "2025-11-14T12:01:16.509903134+08:00" } ] } { "vertexes": [ { "digest": "sha256:b7a3e1705f9d67eefbb40ef26314b9439bf1c654646049863a468a7bdd640a4b", "name": "[internal] load local bake definitions", "started": "2025-11-14T12:01:16.508782743+08:00", "completed": "2025-11-14T12:01:16.509917125+08:00" } ] } { "vertexes": [ { "digest": "sha256:a1cda4d63371bdf0762197232a2e9021e3b301ab34259711c798c11a2a299ae3", "name": "[internal] load build definition from Dockerfile" } ] } { "vertexes": [ { "digest": "sha256:a1cda4d63371bdf0762197232a2e9021e3b301ab34259711c798c11a2a299ae3", "name": "[internal] load build definition from Dockerfile", "started": "2025-11-14T04:01:16.582761925Z", "completed": "2025-11-14T04:01:16.582886246Z" }, { "digest": "sha256:a1cda4d63371bdf0762197232a2e9021e3b301ab34259711c798c11a2a299ae3", "name": "[internal] load build definition from Dockerfile", "started": "2025-11-14T04:01:16.583104488Z" } ] } { "statuses": [ { "id": "transferring dockerfile:", "vertex": "sha256:a1cda4d63371bdf0762197232a2e9021e3b301ab34259711c798c11a2a299ae3", "name": "transferring", "current": 0, "timestamp": "2025-11-14T04:01:16.589609826Z", "started": "2025-11-14T04:01:16.589609369Z" } ] } { "statuses": [ { "id": "transferring dockerfile:", "vertex": "sha256:a1cda4d63371bdf0762197232a2e9021e3b301ab34259711c798c11a2a299ae3", "name": "transferring", "current": 83, "timestamp": "2025-11-14T04:01:16.592862635Z", "started": "2025-11-14T04:01:16.589609369Z" } ] } { "statuses": [ { "id": "transferring dockerfile:", "vertex": "sha256:a1cda4d63371bdf0762197232a2e9021e3b301ab34259711c798c11a2a299ae3", "name": "transferring", "current": 229, "timestamp": "2025-11-14T04:01:16.594147881Z", "started": "2025-11-14T04:01:16.589609369Z", "completed": "2025-11-14T04:01:16.594147468Z" } ] } { "vertexes": [ { "digest": "sha256:a1cda4d63371bdf0762197232a2e9021e3b301ab34259711c798c11a2a299ae3", "name": "[internal] load build definition from Dockerfile", "started": "2025-11-14T04:01:16.583104488Z", "completed": "2025-11-14T04:01:16.59625657Z" } ] } Dockerfile:1 -------------------- 1 | >>> cat > Dockerfile << 'EOF' 2 | FROM nocodb/nocodb:latest 3 | RUN npm install mysql --production --legacy-peer-deps && npm cache clean --force -------------------- failed to solve: dockerfile parse error on line 1: unknown instruction: cat (did you mean cmd?) [root@localhost nocodb-project]# ^C [root@localhost nocodb-project]#
最新发布
11-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值