Submission #3807

#TimeUsernameProblemLanguageResultExecution timeMemory
3807gs13068Divide into triangle (kriii1_D)C++98
Compilation error
0 ms0 KiB
#include<cstdio> int x[900]; int y[900]; bool not[900]; int main() { double t; int bot; int i,j,k,n; scanf("%d",&n); for(i=0;i<n*3;i++)scanf("%d%d",&x[i],&y[i]); j=0; for(i=1;i<n*3;i++) { if(y[i]<y[j]) j=i; } printf("%d ",j+1); not[j]=true; bot=j; for(i=1;i<n*3;i++) { for(k=0;not[k];k++); for(j=k+1;j<n*3;j++) { if(not[j])continue; if(1LL*(x[j]-x[bot])*(y[k]-y[bot])<1LL*(x[k]-x[bot])*(y[j]-y[bot])) k=j; } printf("%d ",k+1); not[k]=true; if(i%3==2)puts(""); } }

Compilation message (stderr)

D.cpp:5:6: error: expected unqualified-id before 'not' token
D.cpp: In lambda function:
D.cpp:21:8: error: expected '{' before '=' token
D.cpp: In function 'int main()':
D.cpp:21:8: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x [enabled by default]
D.cpp:21:8: error: no match for 'operator!' in '!{j}'
D.cpp:21:8: note: candidate is:
D.cpp:21:8: note: operator!(bool) <built-in>
D.cpp:21:8: note:   no known conversion for argument 1 from 'main()::<lambda()>' to 'bool'
D.cpp: In lambda function:
D.cpp:25:17: error: expected '{' before ';' token
D.cpp: In function 'int main()':
D.cpp:25:17: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x [enabled by default]
D.cpp:25:17: error: no match for 'operator!' in '!{k}'
D.cpp:25:17: note: candidate is:
D.cpp:25:17: note: operator!(bool) <built-in>
D.cpp:25:17: note:   no known conversion for argument 1 from 'main()::<lambda()>' to 'bool'
D.cpp: In lambda function:
D.cpp:28:13: error: expected '{' before ')' token
D.cpp: In function 'int main()':
D.cpp:28:13: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x [enabled by default]
D.cpp:28:13: error: no match for 'operator!' in '!{j}'
D.cpp:28:13: note: candidate is:
D.cpp:28:13: note: operator!(bool) <built-in>
D.cpp:28:13: note:   no known conversion for argument 1 from 'main()::<lambda()>' to 'bool'
D.cpp: In lambda function:
D.cpp:33:9: error: expected '{' before '=' token
D.cpp: In function 'int main()':
D.cpp:33:9: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x [enabled by default]
D.cpp:33:9: error: no match for 'operator!' in '!{k}'
D.cpp:33:9: note: candidate is:
D.cpp:33:9: note: operator!(bool) <built-in>
D.cpp:33:9: note:   no known conversion for argument 1 from 'main()::<lambda()>' to 'bool'
D.cpp:9:9: warning: unused variable 't' [-Wunused-variable]
D.cpp:12:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
D.cpp:13:45: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]