2011-04-11から1日間の記事一覧

listの個数の挙動

list list1(26, 'x'); cout while(!list1.empty()) { cout と、 cout for(int i = 0; i { cout は違うんだぜ. 二つ目のはsize()がループするごとにどんどん可変的に減っていくので、ちょうど半分で出力が止まってしまうのです.

SRM 168 DIV2 500

Problem Statement Select two numbers between 1 and 9998, inclusive, which have the same exact group of non-zero digits, but are not the same number. For example, you could use 1234 and 4321, or 91 and 901. Now, subtract the smaller of the …