UVA 247 Calling Circles - ACM/ICPC World Finals 1996

#include<bits/stdc++.h>
using namespace std;
vector<int>a[30];
bool b[30];
int l,d[30][30];
string s1,s2,mp[30];
void find(int x){
    b[x]=1;
    int i,y;
    for(i=0;i<a[x].size();i++){
        y=a[x][i];
        if(!b[y]){
            find(y);
            cout<<", "<<mp[y];
        }
    }
}
int newstr(string s){
    int i;
    for(i=1;i<=l;i++)
        if(mp[i]==s)
            return i;
    mp[++l]=s;
    return l;
}
int main(){
    int i,j,k,n,m,kase=0;
    while(scanf("%d%d",&n,&m)&&n&&m){
        if(kase!=0)printf("\n");
        memset(d,0,sizeof(d));
        l=0;
        for(i=1;i<=m;i++){
            cin>>s1>>s2;
            getchar();
            d[newstr(s1)][newstr(s2)]=1;
        }
        for(k=1;k<=n;k++)
            for(i=1;i<=n;i++)
                for(j=1;j<=n;j++)
                    if(d[i][k]&&d[k][j])
                        d[i][j]=1;
        for(i=1;i<=n;i++)
            a[i].clear();
        for(i=1;i<=n;i++)
            for(j=i+1;j<=n;j++)
                if(d[i][j]&&d[j][i]){
                    a[i].push_back(j);
                    a[j].push_back(i);
                }
        memset(b,0,sizeof(b));
        printf("Calling circles for data set %d:\n",++kase);
        for(i=1;i<=n;i++)
            if(!b[i]){
                cout<<mp[i];
                find(i);
                printf("\n");
            }
    }
    return 0;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Description: An attempt was made to call a method that does not exist. The attempt was made from the following location: org.springframework.boot.autoconfigure.data.redis.LettuceConnectionConfiguration$PoolBuilderFactory.getPoolConfig(LettuceConnectionConfiguration.java:207) The following method did not exist: 'void org.apache.commons.pool2.impl.GenericObjectPoolConfig.setMaxWait(java.time.Duration)' The calling method's class, org.springframework.boot.autoconfigure.data.redis.LettuceConnectionConfiguration$PoolBuilderFactory, was loaded from the following location: jar:file:/D:/Developing%20learning%20software/apache-maven-3.9.2-bin/nfv/org/springframework/boot/spring-boot-autoconfigure/3.1.2/spring-boot-autoconfigure-3.1.2.jar!/org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration$PoolBuilderFactory.class The called method's class, org.apache.commons.pool2.impl.GenericObjectPoolConfig, is available from the following locations: jar:file:/D:/Developing%20learning%20software/apache-maven-3.9.2-bin/nfv/org/apache/commons/commons-pool2/2.6.0/commons-pool2-2.6.0.jar!/org/apache/commons/pool2/impl/GenericObjectPoolConfig.class The called method's class hierarchy was loaded from the following locations: org.apache.commons.pool2.impl.GenericObjectPoolConfig: file:/D:/Developing%20learning%20software/apache-maven-3.9.2-bin/nfv/org/apache/commons/commons-pool2/2.6.0/commons-pool2-2.6.0.jar org.apache.commons.pool2.impl.BaseObjectPoolConfig: file:/D:/Developing%20learning%20software/apache-maven-3.9.2-bin/nfv/org/apache/commons/commons-pool2/2.6.0/commons-pool2-2.6.0.jar org.apache.commons.pool2.BaseObject: file:/D:/Developing%20learning%20software/apache-maven-3.9.2-bin/nfv/org/apache/commons/commons-pool2/2.6.0/commons-pool2-2.6.0.jar Action: Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.autoconfigure.data.redis.LettuceConnectionConfiguration$PoolBuilderFactory and org.apache.commons.pool2.impl.GenericObjectPoolConfig
07-24
The error message suggests that there is a version incompatibility between the classes `LettuceConnectionConfiguration$PoolBuilderFactory` from the Spring Boot autoconfigure library and `GenericObjectPoolConfig` from the Apache Commons Pool library. To resolve this issue, you need to ensure that compatible versions of these libraries are present on your application's classpath. Here's what you can do: 1. Check your application's dependencies: Verify that you have the correct versions of the Spring Boot and Apache Commons Pool libraries specified in your project's dependencies. 2. Resolve version conflicts: If you are using a build tool like Maven or Gradle, ensure that the versions specified for both Spring Boot and Apache Commons Pool are compatible. If there are any conflicting versions, try to align them to a compatible version. 3. Exclude conflicting transitive dependencies: If you are using a build tool, you can exclude the transitive dependencies of Spring Boot or Apache Commons Pool that might be causing conflicts. This can be done by adding exclusion rules in your build file. For example, in Maven, you can exclude a transitive dependency like this: ```xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-autoconfigure</artifactId> <version>3.1.2</version> <exclusions> <exclusion> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> </exclusion> </exclusions> </dependency> ``` By resolving any version conflicts and ensuring compatible versions of the libraries are present on the classpath, you should be able to resolve the method not found error.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值