标签:const log class string 表操作 data clu == stream
1 #include<iostream>
2 #include<cstring>
3 #include<cstdio>
4 #include<algorithm>
5 using namespace std;
6 int n,m,x,g,o;
7 long long y;
8 long long a[100005];
9 int main()
10 {
11 scanf("%d",&n);
12 for(int i=1;i<=n;i++)
13 scanf("%lld",&a[i]);
14 scanf("%d",&m);
15 for(int i=1;i<=m;i++)
16 {
17 scanf("%d",&o);
18 if(o==1)
19 {
20 scanf("%d%lld",&x,&y);
21 a[x]=y;
22 }
23 else if(o==2)
24 {
25 g=0;
26 for(int j=3;j<=n;j++)
27 {
28 for(int k=2;k<=j-1;k++)
29 {
30 for(int p=1;p<=k-1;p++)
31 {
32 if(a[j]+a[k]>a[p]&&a[j]+a[p]>a[k]&&a[k]+a[p]>a[j])
33 {
34 long long h[4];
35 h[1]=a[j];h[2]=a[k];h[3]=a[p];
36 sort(h+1,h+4);
37 for(int j=1;j<=3;j++)
38 printf("%lld ",h[j]);
39 printf("\n");
40 g=1;
41 break;
42 }
43 }
44 if(g==1) break;
45 }
46 if(g==1) break;
47 }
48 if(g==0)
49 printf("-1 -1 -1\n");
50 }
51 }
52 return 0;
53 }
其它两组测试数据:https://files.cnblogs.com/files/grt-lty-love-forever/A%28StandardIO%29.rar
by:ルオ?テンイの锦依卫
未经作者允许,禁止转载!
标签:const log class string 表操作 data clu == stream
原文地址:https://www.cnblogs.com/grt-lty-love-forever/p/10332067.html