SHARE
TWEET

Untitled

a guest Mar 30th, 2017 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.                 #define _CRT_SECURE_NO_WARNINGS
  3. #pragma comment(linker, "/stack:16777216")
  4. #include <string>
  5. #include <vector>
  6. #include <map>
  7. #include <list>
  8. #include <iterator>
  9. #include <cassert>
  10. #include <set>
  11. #include <queue>
  12. #include <iostream>
  13. #include <sstream>
  14. #include <stack>
  15. #include <deque>
  16. #include <cmath>
  17. #include <memory.h>
  18. #include <cstdlib>
  19. #include <cstdio>
  20. #include <cctype>
  21. #include <algorithm>
  22. #include <utility>
  23. #include <time.h>
  24. using namespace std;
  25.  
  26. #define FOR(i, a, b) for(int i=(a);i<(b);i++)
  27. #define RFOR(i, b, a) for(int i=(b)-1;i>=(a);--i)
  28. #define FILL(A,value) memset(A,value,sizeof(A))
  29.  
  30. #define ALL(V) V.begin(), V.end()
  31. #define SZ(V) (int)V.size()
  32. #define PB push_back
  33. #define MP make_pair
  34. #define Pi 3.14159265358979
  35. #define x0 ikjnrmthklmnt
  36. #define y0 lkrjhkltr
  37. #define y1 ewrgrg
  38.  
  39. typedef long long Int;
  40. typedef unsigned long long UInt;
  41. typedef vector<int> VI;
  42. typedef pair<int, int> PII;
  43. typedef pair<Int, Int> PLL;
  44. typedef pair<double, double> PDD;
  45.  
  46. const int INF = 1000000000;
  47. const int BASE = 1000000007;
  48. const int MAX = 10000;
  49. const int MAX2 = 10007;
  50. const int MAXE = 100000;
  51. const int ADD = 1000000;
  52. const int MOD = 1000000007;
  53. const int CNT = 0;
  54.  
  55. int getRand()
  56. {
  57.     int x = 0;
  58.     FOR (i,0,9)
  59.         x = x * 10 + (rand() % 10);
  60.     return x;
  61. }
  62.  
  63. int main(int argc, char* argv[])
  64. {
  65.     int maxN, maxM, isMax, test;
  66.     sscanf(argv[1], "%d", &test);
  67.     sscanf(argv[2], "%d", &maxN);
  68.     sscanf(argv[3], "%d", &maxM);
  69.     sscanf(argv[4], "%d", &isMax);
  70.     srand(test);
  71.  
  72.     int n = getRand() % maxN + 1;
  73.     if (isMax)
  74.         n = maxN;
  75.     printf("%d\n", n);
  76.     FOR (i,0,n)
  77.     {
  78.         if (i != 0)
  79.             printf(" ");
  80.         int w = getRand() % (maxM+1);
  81.         printf("%d", w);
  82.     }
  83.     printf("\n");
  84.  
  85.     return 0;
  86. }
RAW Paste Data
Top