QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#708466#5447. 鸽子TheZoneCompile Error//C++982.6kb2024-11-03 22:42:202024-11-03 22:42:20

Judging History

你现在查看的是最新测评结果

  • [2024-11-03 22:42:20]
  • 评测
  • [2024-11-03 22:42:20]
  • 提交

answer

#include <string>

//you may define some global variables, but it does not work if you try to transfer any information from function pigeon_num or function send to function receive through these variables.
//you had better not use the same global variables in function send and in function receive.

/*
Taskid:         The index of the subtask. If it is subtask 2, then Taskid=2.
k:              The time threshold. Suppose the i-th pigeon taking off is the p_i-th one to land. It is guaranteed that abs(i-p_i)<=k.
return value:   The number of pigeons Little E will use.
*/
int pigeon_num(int Taskid, int k){
	//you may do some initialization for SEND function here
	
	return 5;//change this into your code
}

/*
Taskid:         The index of the subtask. If it is subtask 2, then Taskid=2.
n:              The number of pigeons Little E will use. This equals the return value of function pigeon_num.
k:              The time threshold. Suppose the i-th pigeon taking off is the p_i-th one to land. It is guaranteed that abs(i-p_i)<=k.
msg:            The content of the message.
return value:	The order of the pigeons taking off. The length of this string must be n. return_value[i]='0' means the (i+1)-th pigeon taking off is black. return_value[i]='1' means the (i+1)-th pigeon taking off is white.
*/
std::string send(int Taskid, int n, int k, __uint128_t msg){
	return "10101";//change this into your code
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

class Init{
public:
	Init(){
		//you may do some initialization for RECEIVE function here
	}
};

/*
Taskid:         The index of the subtask. If it is subtask 2, then Taskid=2.
k:              The time threshold. Suppose the i-th pigeon taking off is the p_i-th one to land. It is guaranteed that abs(i-p_i)<=k.
msg:			The order of the pigeons landing. Its length is equal to n. msg[i] denotes the color of the (i+1)-th pigeon watched landing by Little F. '0' means black and '1' means white.
return value:	The content of the message. It should be correct.
*/
__uint128_t receive(int Taskid, int k, const std::string &msg){
	const static Init init;
	{//change this into your code
		__uint128_t hi = 5281683694948011861llu;
		__uint128_t lo = 3195384480471073102llu;
		return hi<<64|lo; //this value equals 97429867398990605044182047185430790478
	}

































































Details

implementer.cpp: In function ‘void encode_main()’:
implementer.cpp:83:18: error: ‘c’ does not name a type
   83 |         for(auto c:code[i]){
      |                  ^
implementer.cpp:85:10: error: expected ‘;’ before ‘}’ token
   85 |         }
      |          ^
      |          ;
   86 |     }
      |     ~     
implementer.cpp:86:5: error: expected primary-expression before ‘}’ token
   86 |     }
      |     ^
implementer.cpp:85:10: error: expected ‘;’ before ‘}’ token
   85 |         }
      |          ^
      |          ;
   86 |     }
      |     ~     
implementer.cpp:86:5: error: expected primary-expression before ‘}’ token
   86 |     }
      |     ^
implementer.cpp:85:10: error: expected ‘)’ before ‘}’ token
   85 |         }
      |          ^
      |          )
   86 |     }
      |     ~     
implementer.cpp:83:12: note: to match this ‘(’
   83 |         for(auto c:code[i]){
      |            ^
implementer.cpp:86:5: error: expected primary-expression before ‘}’ token
   86 |     }
      |     ^
answer.code: In function ‘__int128 unsigned receive(int, int, const string&)’:
answer.code:49:10: error: expected ‘}’ at end of input
   49 |         }
      |          ^
answer.code:43:63: note: to match this ‘{’
   43 | __uint128_t receive(int Taskid, int k, const std::string &msg){
      |                                                               ^