Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- vector<int> rn,iat,rn_st,st,at,tsb,wt,tse,sst,its;
- int get_iat (int n) {
- if (n >= 875) return 9;
- if (n > 750) return 7;
- if (n > 625) return 6;
- if (n > 500) return 5;
- if (n > 375) return 4;
- if (n > 250) return 3;
- if (n > 125) return 2;
- return 1;
- }
- int get_st (int n) {
- if (n > 95) return 6;
- if (n > 85) return 5;
- if (n > 60) return 4;
- if (n > 30) return 3;
- if (n > 10) return 2;
- return 1;
- }
- int main () {
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- int n = rand() % 15 + 1;
- rn.push_back(0);
- for (int i = 0; i < n; ++i) {
- rn.push_back(rand() % 1000 + 1);
- }
- iat.push_back(0);
- for (int i = 1; i < (int) rn.size(); ++i) {
- iat.push_back(get_iat(rn[i]));
- }
- for (int i = 0; i < n; ++i) {
- rn_st.push_back(rand() % 100 + 1);
- }
- st.push_back(0);
- for (int i = 0; i < n; ++i) {
- st.push_back(get_st(rn_st[i]));
- }
- at.push_back(0);
- for (int i = 1; i < n; ++i) {
- at.push_back(at.back() + iat[i]);
- }
- tsb.push_back(0);
- for (int i = 1; i < n; ++i) {
- tsb.push_back(max(tsb.back() + st[i - 1],at[i]));
- }
- for (int i = 0; i < n; ++i) {
- wt.push_back(tsb[i] - at[i]);
- }
- for (int i = 0; i < n; ++i) {
- tse.push_back(tsb[i] + st[i]);
- }
- for (int i = 0; i < n; ++i) {
- sst.push_back(st[i] + wt[i]);
- }
- its.push_back(0);
- for (int i = 1; i < n; ++i) {
- its.push_back(abs(tse[i - 1] - tsb[i]));
- }
- cout << "SN\tRN\tIAT\tAT\tRN_ST\tST\tTSB\tWT\tTSE\tSST\tITS\n";
- for (int i = 0; i < n; ++i) {
- cout << i << '\t' << rn[i] << '\t' << iat[i] << '\t' << at[i] << '\t' << rn_st[i] << '\t' << st[i] << '\t' << tsb[i] << '\t' << wt[i] << '\t' << tse[i] << '\t' << sst[i] << '\t' << its[i] << '\n';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement