(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

제출 #1089353

#제출 시각아이디문제언어결과실행 시간메모리
1089353TlenekWodoru비스킷 담기 (IOI20_biscuits)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> //#include "biscuits.h" using namespace std; bitset<128>tab[2][128]; bitset<128>B; long long count_tastiness(long long x,vector<long long>AA) { while(AA.size()<10){AA.push_back(0);} vector<__int128>A; for(auto u : AA){A.push_back(u);} const int n=A.size(); __int128 s=0; vector<long long>dp(n); dp.push_back(1); for(int i=0;i<n;i++) { s+=A[i]*((long long)1<<i); __int128 u=s/x; if(u>=((__int128)1<<(i+1))) { for(int j=0;j<=i;j++) { tab[1][j][i]=1; } } else { for(int j=0;j<=i;j++) { if(u%2==0) { tab[0][j][i]=1; } else { tab[1][j][i]=1; } u>>=1; } } } for(int i=8;i>=0;i--) { for(int j=0;j<=8;j++) { cout<<tab[1][j][i]<<' '; } cout<<endl; } for(int i=n-1;i>=1;i--) { if(dp[i+1]!=0) { cout<<"dp["<<i+1<<"]="<<dp[i+1]<<endl; for(int j=0;j<128;j++) { B[j]=0; } for(int j=i;j>=0;j--) { B[j]=1; if((B|tab[0][j]).count()==0) { dp[j]+=dp[i+1]; } else { B&=(B|tab[0][j]); } } dp[0]+=dp[i+1]; } for(int j=0;j<=i;j++) { tab[0][j][i]=0; tab[1][j][i]=0; } } return dp[0]; } /** 1 3 3 5 2 1 3 2 2 1 2 **/ int main() { int q; cin>>q; vector<int> k(q); vector<long long> x(q); vector<vector<long long>> a(q); vector<long long> results(q); for (int t = 0; t < q; t++) { cin>>k[t]>>x[t]; a[t] = vector<long long>(k[t]); for (int i = 0; i < k[t]; i++) { cin>>a[t][i]; } } for (int t = 0; t < q; t++) { results[t] = count_tastiness(x[t], a[t]); } for (int t = 0; t < q; t++) { printf("%lld\n", results[t]); } return 0; }

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

/usr/bin/ld: /tmp/cc7OjjBb.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccp1HWS9.o:biscuits.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status