/ SeriousOJ /

Record Detail

Memory Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 0ms 284.0 KiB
#2 Accepted 2ms 284.0 KiB
#3 Time Exceeded ≥1088ms ≥500.0 KiB
#4 Memory Exceeded ≥244ms ≥256.016 MiB

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:25:01
Judged At
2024-10-03 13:22:08
Judged By
Score
40
Total Time
≥1088ms
Peak Memory
≥256.016 MiB