Memory Exceeded
Code
#include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
for(int i=1;i<=t;i++)
{
int n;
scanf("%d",&n);
int ar[n];
int k=1;
int count=0;
for(int i=0;i<n;i++)
{
ar[i]=k;
k++;
}
int j=1;
for(int p=0;p<(n-1);p++)
{
for(int i=j;i<n;i++)
{
if(ar[p]+ar[i]==n)
{
count++;
}
}
j++;
}
printf("%d\n",count);
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1073 Pair Sum
- Contest
- Bangladesh 2.0
- Language
- C11 (GCC 13.2.0)
- Submit At
- 2024-08-16 17:19:34
- Judged At
- 2024-10-03 13:22:35
- Judged By
- Score
- 40
- Total Time
- ≥1089ms
- Peak Memory
- ≥256.016 MiB