大牛帮看看

记录信息
评测状态    Wrong Answer
题目  P1512 SuperBrother打鼹鼠
递交时间    2016-08-06 21:54:49
代码语言    C++
评测机 ShadowShore
消耗时间    824 ms
消耗内存    4660 KiB
评测时间    2016-08-06 21:54:51
评测结果
编译成功

测试数据 #0: Accepted, time = 0 ms, mem = 4656 KiB, score = 10
测试数据 #1: WrongAnswer, time = 312 ms, mem = 4656 KiB, score = 0
测试数据 #2: Accepted, time = 0 ms, mem = 4652 KiB, score = 10
测试数据 #3: Accepted, time = 15 ms, mem = 4656 KiB, score = 10
测试数据 #4: Accepted, time = 234 ms, mem = 4660 KiB, score = 10
测试数据 #5: Accepted, time = 0 ms, mem = 4652 KiB, score = 10
测试数据 #6: Accepted, time = 46 ms, mem = 4656 KiB, score = 10
测试数据 #7: Accepted, time = 15 ms, mem = 4652 KiB, score = 10
测试数据 #8: Accepted, time = 31 ms, mem = 4652 KiB, score = 10
测试数据 #9: Accepted, time = 171 ms, mem = 4656 KiB, score = 10
WrongAnswer, time = 824 ms, mem = 4660 KiB, score = 90
代码
#include <bits/stdc++.h>
const int maxn = 1024;
int map[maxn][maxn],n;
int main() {
  int m;
  scanf("%d",&n);
  memset(map,0,sizeof(map));
  while (scanf("%d",&m))
    switch (m) {
      case 1 : {
        int x,y,cnt;
        scanf("%d%d%d",&x,&y,&cnt);
        x++,y++;
        map[x][y] += cnt;
        break;
      }
      case 2 : {
        int x1,y1,x2,y2,ans = 0;
        scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
        x1++,x2++,y1++,y2++;
        for (int i = x1;i <= x2;i++)
          for (int j = y1;j <= y2;j++)
            ans += map[i][j];
        printf("%d\n",ans);
        break;
      }
      case 3 : return 0;
    }
}

0 条评论

目前还没有评论...

信息

ID
1512
难度
6
分类
数据结构 | 树状数组 点击显示
标签
(无)
递交数
2871
已通过
794
通过率
28%
被复制
2
上传者