Quantcast
Channel: C++博客-所有随笔
Viewing all articles
Browse latest Browse all 7882

UVa 119 Greedy Gift Givers

$
0
0

总结

简单的模拟问题

陷阱

  1. “Any money not given is kept and is part of a person's ``net worth'' printed in the output.” 无论如何理解,最后输出的净收入/净支出就是得到的钱减去花出的钱。剩下的不算。
  2. “The output for each group should be separated from other groups by a blank line” 如果你在每组答案末尾输出空行,那么你的输出末尾会多一个空行,这样你会得到一个WA,而不是PE。解决方法可以在除第一组答案之外的所有答案之前输出一个空行。比如使用一个计数器。
    
    if (counter > 1) cout << endl;
    


happyac 2013-06-13 08:23 发表评论

Viewing all articles
Browse latest Browse all 7882

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>