0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2025-01-11 16:31:58 +00:00

#1167. 【模板】函数式交互 / 一道开业の函数式交互题

https://sjzezoj.com/submission/46420
This commit is contained in:
Baoshuo Ren 2022-01-03 20:11:48 +08:00
parent 72624c0e4d
commit 1a3d46c357
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68
3 changed files with 32 additions and 0 deletions

7
S2OJ/1167/1167.cpp Normal file
View File

@ -0,0 +1,7 @@
// Compile command: g++ implementer.cpp 1167.cpp -o 1167 -O2 -lm
#include "head.h"
unsigned solv(unsigned a, unsigned b) {
return a * b;
}

1
S2OJ/1167/head.h Normal file
View File

@ -0,0 +1 @@
unsigned int solv(unsigned int, unsigned int);

24
S2OJ/1167/implementer.cpp Normal file
View File

@ -0,0 +1,24 @@
#include <bits/stdc++.h>
#include "head.h"
static inline unsigned int randnum() {
static unsigned int seed = time(nullptr);
return seed ^= seed << 5, seed ^= seed >> 7, seed ^= seed << 13;
}
std::string str = "1145141919810efghkkk";
signed main() {
int n;
std::cin >> n;
unsigned int ps = (randnum() % str.length());
if (!ps) ++ps;
std::cout << str.substr(0, ps);
for (int i = 1; i <= n; ++i) {
unsigned int a = randnum(), b = randnum();
unsigned int ret = solv(a, b);
if (i == 1) std::cout << str.substr(ps) << '\n';
std::cout << a * b << ' ' << ret << '\n';
}
}