제출 #1184899

#제출 시각아이디문제언어결과실행 시간메모리
1184899islam_2010Connecting Supertrees (IOI20_supertrees)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "supertrees.h" #define all(x) x.begin(), x.end() #define int long long #define pii pair<int, int> using namespace std; const int sz = 1e5 + 5; const int mod = 1e9+7; int binpow(int x, int n){ int res = 1; n%=mod; while (n > 0){ if(n&1){ res = res * x % mod; }x = x * x % mod; n/=2; }return res; } int gcd(int a, int b){ if(b == 0){ return a; } return gcd(b, a % b); } bool is_prime(int n){ if(n==1){ return false; }if(n==2){ return true; } for(int i = 2; i * i <= n; i++){ if(n%i==0){ return false; } }return true; } int construct(int p){ int n = p.size(); bool flag=true; for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ if(p[i][j]!='1'){ flag=false; break; } }if(!flag){ break; } }if(flag){ return 1; } } // signed main() { // ios_base::sync_with_stdio(false); // cin.tie(0); // return 0; // }

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

supertrees.cpp: In function 'long long int construct(long long int)':
supertrees.cpp:46:15: error: request for member 'size' in 'p', which is of non-class type 'long long int'
   46 |     int n = p.size();
      |               ^~~~
supertrees.cpp:50:17: error: invalid types 'long long int[long long int]' for array subscript
   50 |             if(p[i][j]!='1'){
      |                 ^
supertrees.cpp:60:1: warning: control reaches end of non-void function [-Wreturn-type]
   60 | }
      | ^