??????????

测试数据 #0: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #1: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #2: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #3: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #4: Accepted, time = 15 ms, mem = 504 KiB, score = 1
测试数据 #5: Accepted, time = 0 ms, mem = 504 KiB, score = 1
测试数据 #6: Accepted, time = 15 ms, mem = 508 KiB, score = 1
测试数据 #7: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #8: Accepted, time = 0 ms, mem = 504 KiB, score = 1
测试数据 #9: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #10: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #11: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #12: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #13: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #14: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #15: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #16: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #17: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #18: Accepted, time = 0 ms, mem = 512 KiB, score = 1
测试数据 #19: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #20: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #21: Accepted, time = 0 ms, mem = 504 KiB, score = 1
测试数据 #22: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #23: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #24: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #25: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #26: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #27: Accepted, time = 0 ms, mem = 512 KiB, score = 1
测试数据 #28: Accepted, time = 0 ms, mem = 512 KiB, score = 1
测试数据 #29: Accepted, time = 15 ms, mem = 508 KiB, score = 1
测试数据 #30: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #31: Accepted, time = 0 ms, mem = 504 KiB, score = 1
测试数据 #32: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #33: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #34: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #35: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #36: Accepted, time = 0 ms, mem = 504 KiB, score = 1
测试数据 #37: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #38: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #39: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #40: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #41: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #42: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #43: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #44: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #45: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #46: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #47: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #48: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #49: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #50: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #51: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #52: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #53: Accepted, time = 0 ms, mem = 512 KiB, score = 1
测试数据 #54: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #55: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #56: Accepted, time = 0 ms, mem = 504 KiB, score = 1
测试数据 #57: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #58: Accepted, time = 0 ms, mem = 504 KiB, score = 1
测试数据 #59: Accepted, time = 15 ms, mem = 508 KiB, score = 1
测试数据 #60: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #61: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #62: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #63: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #64: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #65: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #66: Accepted, time = 0 ms, mem = 512 KiB, score = 1
测试数据 #67: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #68: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #69: Accepted, time = 0 ms, mem = 512 KiB, score = 1
测试数据 #70: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #71: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #72: Accepted, time = 0 ms, mem = 504 KiB, score = 1
测试数据 #73: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #74: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #75: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #76: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #77: Accepted, time = 0 ms, mem = 504 KiB, score = 1
测试数据 #78: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #79: Accepted, time = 0 ms, mem = 504 KiB, score = 1
测试数据 #80: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #81: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #82: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #83: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #84: Accepted, time = 0 ms, mem = 512 KiB, score = 1
测试数据 #85: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #86: Accepted, time = 15 ms, mem = 512 KiB, score = 1
测试数据 #87: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #88: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #89: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #90: Accepted, time = 0 ms, mem = 504 KiB, score = 1
测试数据 #91: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #92: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #93: Accepted, time = 0 ms, mem = 512 KiB, score = 1
测试数据 #94: WrongAnswer, time = 0 ms, mem = 508 KiB, score = 0
测试数据 #95: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #96: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #97: Accepted, time = 0 ms, mem = 508 KiB, score = 1
测试数据 #98: Accepted, time = 15 ms, mem = 508 KiB, score = 1
测试数据 #99: Accepted, time = 15 ms, mem = 508 KiB, score = 1

4 条评论

  • @ 2016-10-20 18:22:31
    // input code here
    
  • @ 2016-10-16 15:01:10

    你先把代码发上来、
    给你看看、

    • @ 2016-10-20 07:41:22

      #include<cstdio>
      #include<cstring>
      #include<climits>

      int t,n,x,y,a[5],b[14],maxx;

      int qiu(){
      int tot=0;
      memset(a,0,sizeof(a));
      for(int i=0;i<=13;i++) a[b[i]]++;
      while(a[4] && a[2]>1) a[4]--,a[2]-=2,tot++;
      while(a[4] && a[1]>1) a[4]--,a[1]-=2,tot++;
      while(a[4] && a[2]) a[4]--,a[2]--,tot++;
      while(a[3] && a[2]) a[3]--,a[2]--,tot++;
      while(a[3] && a[1]) a[3]--,a[1]--,tot++;
      return tot+a[1]+a[2]+a[3]+a[4];
      }

      void dfs(int u)
      {
      if(u>=maxx) return;int kk=qiu();
      if(u+kk<maxx) maxx=u+kk;
      for(int i=2;i<=13;i++)
      {
      int j=i;
      while(b[j]>=3 && j<=13) j++;
      if(j-i>=2)
      for(int v=i+1;v<=j-1;v++)
      {

      for(int vk=i;vk<=v;vk++) b[vk]-=3;
      dfs(u+1);
      for(int vk=i;vk<=v;vk++) b[vk]+=3;
      }
      }
      for(int i=2;i<=13;i++)
      {
      int j=i;
      while(b[j]>=2 && j<=13) j++;
      if(j-i>=3)
      for(int v=i+2;v<=j-1;v++)
      {
      for(int vk=i;vk<=v;vk++) b[vk]-=2;
      dfs(u+1);
      for(int vk=i;vk<=v;vk++) b[vk]+=2;
      }
      }
      for(int i=2;i<=13;i++)
      {
      int j=i;
      while(b[j]>=1 && j<=13) j++;
      if(j-i>=5)
      for(int v=i+4;v<=j-1;v++)
      {
      for(int vk=i;vk<=v;vk++) b[vk]--;
      dfs(u+1);
      for(int vk=i;vk<=v;vk++) b[vk]++;
      }
      }
      }

      int main()
      {
      scanf("%d%d",&t,&n);
      while(t--){
      maxx=INT_MAX;
      memset(b,0,sizeof(b));
      for(int i=1;i<=n;i++){
      scanf("%d%d",&x,&y);
      if(x==1) x=13;
      else if(x) x--;
      b[x]++;
      }
      dfs(0);
      printf("%d\n",maxx);
      }
      return 0;
      }

  • @ 2016-10-16 15:01:07

    你先把代码发上来、
    给你看看、

  • @ 2016-10-16 11:26:41

    大神帮帮忙。。。

    • @ 2016-10-16 15:01:21

      你先把代码发上来、
      给你看看、

  • 1

信息

ID
1980
难度
8
分类
(无)
标签
递交数
2591
已通过
352
通过率
14%
被复制
12
上传者