QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#307586#6659. 외곽 순환 도로 2hjl666Compile Error//C++141.9kb2024-01-18 20:47:362024-01-18 20:47:37

Judging History

你现在查看的是测评时间为 2024-01-18 20:47:37 的历史记录

  • [2024-08-26 15:51:57]
  • 管理员手动重测本题所有提交记录
  • [2024-01-18 20:47:37]
  • 评测
  • [2024-01-18 20:47:36]
  • 提交

answer

#include<bits/stdc++.h>
#define db double
// #define int ll
#define ll long long
#define ull unsigned long long
#define pb emplace_back
#define MP make_pair
#define pii pair<int, ll>
#define vec vector<int>
#define fi first
#define se second
#define ls k<<1
#define rs k<<1|1
#define CLK (double)clock()/(double)CLOCKS_PER_SEC
using namespace std;
mt19937 rnd(time(0));
inline int read(){
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
inline void write(int x){
    if(x<0){putchar('-');x=-x;}
    if(x>9)write(x/10);
    putchar(x%10+'0');
}
const int N=1e5+5;
int n,fa[N],leaf,L[N],R[N],Dfn;
ll f[N][2][2][2],g[2][2][2],val[N],circ[N];vector<pii> G[N];
void chkmin(ll &x,ll y){x=min(x,y);}
void dfs(int x,int fa){
    f[x][0][0][0]=f[x][1][1][1]=0;
    if(G[x].empty()){
        L[x]=R[x]=++Dfn;
        return ;
    }
    int son=0;
    for(auto [y,w]:G[x]){
        dfs(y,x);son++;
        memcpy(g,f[x],sizeof g),memset(f[x],0x3f,sizeof f[x]);
        for(int a=0;a<2;a++)for(int b=0;b<2;b++)for(int c=0;c<2;c++)
        for(int i=0;i<2;i++)for(int j=0;j<2;j++)for(int k=0;k<2;k++){
            if(son==1){
                ll val=g[a][b][c]+f[y][i][j][k];
                if(c==j)val+=circ[R[x]];
                if(a==i)val+=w;
                chkmin(f[x][a][j][k],val);
                continue;
            }
            ll val=g[a][b][c]+f[y][i][j][k];
            if(c==j)val+=circ[R[x]];
            if(a==i)val+=w;
            chkmin(f[x][a][b][k],val);//cerr<<x<<' '<<f[x][a][l][r]<<"\n";
        }
        if(!L[x])L[x]=L[y];R[x]=R[y];
        // cout<<x<<' '<<y<<"\n";
        // for(int a=0;a<2;a++)for(int b=0;b<2;b++)for(int c=0;c<2;c++)cout<<a<<' '<<b<<' '<<c<<' '<<f[x][a][b][c]<<"\n";
    }
    // cerr<<x<<' '<<L[x]<<' '<<R[x]<<"\n";
}

详细

cc1plus: fatal error: implementer.cpp: No such file or directory
compilation terminated.
answer.code: In function ‘void dfs(int, int)’:
answer.code:40:14: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   40 |     for(auto [y,w]:G[x]){
      |              ^