随笔- 51  文章- 0  评论- 2  阅读- 14592 

为何我要做此等弱智题,只因我太久不码代码,心有所虚…

明天的任务是,做些难题,累了就理房间,实在不行就睡觉,不要做别的事情w 目测自己做不到呢OAO

复制代码
program vijos_p1035;
var namelist:array[1..10] of string;
    ans:array[1..10] of integer;
    n,i,j,ni,money:integer;
    s,ss:string;
function loc(st:string):integer;
var i:integer;
begin
  i:=1;
  while namelist[i]<>st do inc(i);
  exit(i);
end;
begin {main}
  readln(n);
  for i:=1 to n do
    readln(namelist[i]);
  for j:=1 to n do
    begin
      readln(s);
      readln(money,ni);
      for i:=1 to ni do
        begin
          readln(ss);
          inc(ans[loc(ss)],money div ni);
        end;
      if ni<>0 then dec(ans[loc(s)],money div ni * ni);
    end;
  for i:=1 to n do
    writeln(namelist[i],' ',ans[i]);
end.
贪婪的送礼者
复制代码

测试数据 #0: Accepted, time = 0 ms, mem = 744 KiB, score = 10

测试数据 #1: Accepted, time = 0 ms, mem = 744 KiB, score = 10

测试数据 #2: Accepted, time = 15 ms, mem = 744 KiB, score = 10

测试数据 #3: Accepted, time = 15 ms, mem = 744 KiB, score = 10

测试数据 #4: Accepted, time = 0 ms, mem = 744 KiB, score = 10

测试数据 #5: Accepted, time = 0 ms, mem = 744 KiB, score = 10

测试数据 #6: Accepted, time = 0 ms, mem = 744 KiB, score = 10

测试数据 #7: Accepted, time = 0 ms, mem = 748 KiB, score = 10

测试数据 #8: Accepted, time = 0 ms, mem = 744 KiB, score = 10

测试数据 #9: Accepted, time = 0 ms, mem = 740 KiB, score = 10

Accepted, time = 30 ms, mem = 748 KiB, score = 100

 

 posted on   Sky-Grey  阅读(389)  评论(0编辑  收藏  举报
编辑推荐:
· 智能桌面机器人:用.NET IoT库控制舵机并多方法播放表情
· Linux glibc自带哈希表的用例及性能测试
· 深入理解 Mybatis 分库分表执行原理
· 如何打造一个高并发系统?
· .NET Core GC压缩(compact_phase)底层原理浅谈
阅读排行:
· 手把手教你在本地部署DeepSeek R1,搭建web-ui ,建议收藏!
· 新年开篇:在本地部署DeepSeek大模型实现联网增强的AI应用
· Janus Pro:DeepSeek 开源革新,多模态 AI 的未来
· 互联网不景气了那就玩玩嵌入式吧,用纯.NET开发并制作一个智能桌面机器人(三):用.NET IoT库
· 【非技术】说说2024年我都干了些啥
点击右上角即可分享
微信分享提示