제출 #1017552

#제출 시각아이디문제언어결과실행 시간메모리
1017552simona1230친구 (IOI14_friend)C++17
16 / 100
1 ms2496 KiB
#include <bits/stdc++.h> #include "friend.h" using namespace std; int c[100001]; int p[100001]; int t[100001]; int n; int findSample(int N,int confidence[],int host[],int protocol[]) { n=N; int sum=0,maxx=0; for(int i=0;i<n;i++) { t[i]=protocol[i]; //cout<<"- "<<t[i]<<endl; c[i]=confidence[i]; p[i]=host[i]; sum+=c[i]; maxx=max(maxx,c[i]); } //cout<<sum<<endl; bool o1=1; for(int i=1;i<n;i++) if(t[i]!=1)o1=0; //cout<<o1<<endl; if(o1==1)return sum; bool o2=1; for(int i=1;i<n;i++) if(t[i]!=2)o2=0; if(o2==1)return maxx; }

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

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:31:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   31 |     for(int i=1;i<n;i++)
      |     ^~~
friend.cpp:33:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   33 |  if(o2==1)return maxx;
      |  ^~
friend.cpp:34:1: warning: control reaches end of non-void function [-Wreturn-type]
   34 | }
      | ^
#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...