daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest Dec 4th, 2018 1,044 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. int a[2005];
  4. int main()
  5. {
  6.     int n;
  7.     scanf("%d",&n);
  8.     for (int i=0;i<n;i++)
  9.     scanf("%d",&a[i]);
  10.     printf("%d\n",n+1);
  11.     int sum=0;
  12.     for (int i=n-1;i>=0;i--)
  13.     {
  14.         int add=(i-(a[i]+sum)%n+n)%n;
  15.         printf("1 %d %d\n",i+1,add);
  16.         sum+=add;
  17.     }
  18.     printf("2 %d %d",n,n);
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top