Skip to content

Instantly share code, notes, and snippets.

@nalimilan
Created March 6, 2016 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nalimilan/fffd490da8686ef72ab2 to your computer and use it in GitHub Desktop.
Save nalimilan/fffd490da8686ef72ab2 to your computer and use it in GitHub Desktop.
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv) {
int A[1000000];
int B[1000000];
int i = 1000000;
int j = 1000000;
int s;
bool same = strcmp(argv[1], "0");
while(i > 0 && (same || j > 0)) {
i--;
if(same)
j = i;
else
j--;
s += A[i] * B[j];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment