#include "recorder.h" #include "utils.h" #include #include #include #include using namespace std; struct ExampleTask { string s; long long score() { auto answer = 0; for (auto x : s) { answer += x == 'a'; } return answer; } void save(ostream &output, ostream &info) { output << s << endl; info << "string: " << s << endl; } void load(istream &output, istream &info) { output >> s; } }; int main() { Recorder rec("a"); ExampleTask task; rec.load(task); task.s = "aafasfasfasfasfdasdf"; rec.submit(task); long long pig = 0; // This function will be called multiple times for 10 milliseconds. // It will be checked every 2_000_000 iterations. run_while([&]() { pig++; }, 2000000, 10); cout << pig << endl; return 0; }