/ SeriousOJ /

Record Detail

Memory Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 0ms 320.0 KiB
#2 Accepted 2ms 320.0 KiB
#3 Time Exceeded ≥1070ms ≥500.0 KiB
#4 Memory Exceeded ≥242ms ≥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-11-11 03:11:48
Judged By
Score
40
Total Time
≥1070ms
Peak Memory
≥256.016 MiB