fork download
  1. #include "message.h"
  2. #include "rps.h"
  3. #include <bits/stdc++.h>
  4.  
  5. typedef long long int lli;
  6. using namespace std;
  7.  
  8. const int nnodes = NumberOfNodes();
  9. const int nodeId = MyNodeId();
  10. const int N = (int)GetN();
  11.  
  12. int main() {
  13.  
  14. if(!nodeId){
  15. for(int i=1;i<nnodes;i++){
  16. while(1){
  17. Receive(i);
  18. int num = GetInt(i);
  19. if(num==-1){
  20. break;
  21. }
  22. }
  23. }
  24. vector<char> C(1<<N);
  25. vector<int> A(1<<N);
  26. for(int i=0;i<C.size();i++){
  27. A[i] = i;
  28. C[i] = GetFavoriteMove(i);
  29. }
  30.  
  31. while((int)A.size() != 1){
  32. vector<char> tmp((A.size())>>1);
  33. for(int i=0;i<A.size(); i+=2){ // S P R
  34. if(C[A[i]] == 'S' && C[A[i+1]] == 'P'){
  35. tmp[(i>>1)] = A[i];
  36. }
  37. if(C[A[i]] == 'P' && C[A[i+1]] == 'S'){
  38. tmp[(i>>1)] = A[i+1];
  39. }
  40. if(C[A[i]] == 'P' && C[A[i+1]] == 'R'){
  41. tmp[(i>>1)] = A[i];
  42. }
  43. if(C[A[i]] == 'R' && C[A[i+1]] == 'P'){
  44. tmp[(i>>1)] = A[i+1];
  45. }
  46. if(C[A[i]] == 'S' && C[A[i+1]] == 'R'){
  47. tmp[(i>>1)] = A[i+1];
  48. }
  49. if(C[A[i]] == 'R' && C[A[i+1]] == 'S'){
  50. tmp[(i>>1)] = A[i];
  51. }
  52. if(C[A[i]] == C[A[i+1]]){
  53. tmp[(i>>1)] = A[i];
  54. }
  55. }
  56. A.resize(tmp.size());
  57. for(int i=0;i<tmp.size();i++)
  58. A[i] = tmp[i];
  59. tmp.clear();
  60. }
  61. cout << A[0] << "\n";
  62. }
  63. else{
  64. PutInt(0,-1);
  65. Send(0);
  66. }
  67.  
  68.  
  69. return 0;
  70. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:21: fatal error: message.h: No such file or directory
 #include "message.h"
                     ^
compilation terminated.
stdout
Standard output is empty