记录编号 453592 评测结果 AAAAAAAAAA
题目名称 失落的猴子 最终得分 100
用户昵称 Gravatarzero 是否通过 通过
代码语言 C++ 运行时间 1.147 s
提交时间 2017-09-21 19:53:58 内存使用 4.14 MiB
显示代码纯文本
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cmath>
  4. using namespace std;
  5. int kaishi[1001][1001]={0};
  6. void into(){
  7. int x,y,a,b,k,cd,kd,mmp;
  8. cin>>cd>>kd>>k;
  9. for(int i=1;i<=k;i++){
  10. cin>>x>>y>>a>>b>>mmp;
  11. if(x>a){
  12. swap(x,a);
  13. }
  14. if(y>b){
  15. swap(y,b);
  16. }
  17. for(int j=x;j<=a;j++){
  18. for(int p=y;p<=b;p++){
  19. kaishi[j][p]=mmp;
  20. }
  21. }
  22. }
  23. for(int j=1;j<=cd;j++){
  24. for(int p=1;p<=kd;p++){
  25. cout<<kaishi[j][p];
  26. }
  27. cout<<endl;
  28. }
  29. }
  30. int main(){
  31. freopen("lostmonkey.in","r",stdin);
  32. freopen("lostmonkey.out","w",stdout);
  33. into();
  34. return 0;
  35. }