比赛 “Asm.Def战记之拉格朗日点”杯 评测结果 AAWWWWWAWW
题目名称 Asm.Def的微小贡献 最终得分 30
用户昵称 1azyReaper 运行时间 0.002 s
代码语言 C++ 内存使用 0.46 MiB
提交时间 2015-11-04 11:55:53
显示代码纯文本
  1. #include <fstream>
  2. #include <algorithm>
  3. #include <cstdio>
  4. #include <cstring>
  5. #define ifs ifstream
  6. #define ofs ofstream
  7. #define MAX 10010
  8. using namespace std;
  9. typedef long long ll;
  10. ifs fin("asm_contribute.in");
  11. ofs fout("asm_contribute.out");
  12. ll a[MAX],ans[MAX];
  13. int n;
  14. int read()
  15. {
  16. fin>>n;
  17. for(int i=1;i<=n;i++)
  18. fin>>a[i];
  19. return 0;
  20. }
  21. int work()//暴力出奇迹(啦啦啦)
  22. {
  23. for(int k=1;k<=n;k++)
  24. {
  25. ans[k]=ans[k-1]^a[k];
  26. for(int i=k+1;i<=n;i++)
  27. {
  28. if((a[i]^ans[k])==0)
  29. {
  30. fout<<k+1<<endl;
  31. for(int j=1;j<=k;j++)
  32. {
  33. fout<<j<<' ';
  34. }fout<<i<<endl;
  35. return 0;
  36. }
  37. }
  38. }
  39. return 0;
  40. }
  41. int main()
  42. {
  43. read();
  44. work();
  45. return 0;
  46. }