제출 #689806

#제출 시각아이디문제언어결과실행 시간메모리
689806TomitaMateiTable Tennis (info1cup20_tabletennis)C++14
9 / 100
8 ms860 KiB
#include <iostream>
#include <algorithm>
using namespace std;

int n,k,i,j,i1,j1,st,dr,s,nr,v[16000];
int main()
{
    cin>>n>>k;
    for (i=1; i<=n+k; i++)
        cin>>v[i];
        sort (v,v+n+1);
    for (st=1; st<=k+1; st++)
        for (dr=n; dr>=st+n-1; dr--)
    {
        i=st;
        j=dr;
        s=v[i]+v[j];
        i++;
        j--;
        nr=2;
        while (s==v[i]+v[j])
        {

            nr=nr+2;
            if (nr==n)
            {
              for (i1=st; i1<=i; i1++)
                    cout<<v[i1]<<" ";
              for (j1=j; j1<=dr; j1++)
                cout<<v[j1]<<" ";
                return 0;

            }
        i++;
         j--;
        }


    }
    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

tabletennis.cpp: In function 'int main()':
tabletennis.cpp:9:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    9 |     for (i=1; i<=n+k; i++)
      |     ^~~
tabletennis.cpp:11:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   11 |         sort (v,v+n+1);
      |         ^~~~
tabletennis.cpp:29:15: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   29 |               for (j1=j; j1<=dr; j1++)
      |               ^~~
tabletennis.cpp:31:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   31 |                 return 0;
      |                 ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...