Input/Output clarification

Input/Output clarification

dotcsw的头像

This is my understanding of the input and output descriptions:

  1. The input consists of three command line arguments, each of which is exactly 32 hex digits long.
  2. The output should be something like "574395734 cycles" printed to stdout.
  3. The program need not specify if it terminated due to all zeros or repeating the initial values.
  4. Elapsed time and units (seconds or milliseconds) should be printed to stderr.

Are any of these inferences wrong?

As far as the input, my program handles hex strings longer/shorter than 32 digits by truncating/zero-padding the most significant digits (and issuing a warning to stderr). This is useful for running small tests involving only one DWORD.

The thing about "output to stdout" and "time to stderr" is something I picked up from another Threading Challenge problem. It probably doesn't matter but I noticed log files created by batch jobs on the MTL record stderr output before stdout, reversing the order of my printf's.

- Rick

2 帖子 / 0 new
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
hitesh.sharma的头像

my assumption:
Every point is fine except the last one.
Every approach is fine unless it affect the requirement.
I do not see any specific need of printing no of cycles on stderr because this is just for the sake of seeing program execution time. it should be stdout.

登陆并发表评论。