Skip to content

Instantly share code, notes, and snippets.

@syst3mw0rm
Created December 12, 2013 16:09
Show Gist options
  • Select an option

  • Save syst3mw0rm/7930523 to your computer and use it in GitHub Desktop.

Select an option

Save syst3mw0rm/7930523 to your computer and use it in GitHub Desktop.
#include<iostream>
#include<vector>
#include<cstdio>
#include<set>
#include<map>
#include<algorithm>
#include<string.h>
#include<string>
#include<cassert>
#include<stack>
#include<queue>
#include<cmath>
using namespace std;
typedef long long LL;
int main() {
int n;
LL d;
vector<LL> num;
scanf("%d", &n);
LL pro=1ll;
for(int i=0;i<n;i++) {
scanf("%lld", &d);
num.push_back(d);
}
for(int i=1;i<n;i++) {
pro = pro * num[i];
}
printf("%lld\n", pro);
for(int i=1;i<n;i++) {
pro = pro / num[i];
pro = pro * num[i-1];
printf("%lld\n", pro);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment