목록백준 문제 코드 (38)
Deep Learning study
#include #include using namespace std; long long int m,M; bool check[5000001]; int main(){ cin >> m >> M; int cnt=0; for(long long int i=2 ; i*i
#include #include #include #include using namespace std; #define ll long long #define INF 1e9+7 int main(){ ios_base::sync_with_stdio(0); int t; cin >> t; while(t--){ int lim,n; ll ans=INF; vector a[4],s[2]; cin >> lim >> n; for(int i=0 ;i
#include #include #include using namespace std; char a[1000001]; bool erased[1000001]; char b[100]; int main() { scanf("%s",a); scanf("%s",b); int n = strlen(a); int m = strlen(b); if (m == 1) { for (int i=0; i
#include #include using namespace std; bool ck[5000][5000]; void tristar(int now) { for (int i = now + 1; i n; ck[1][1]= ck[2][1] = ck[3][1] = ck[2][3] = ck[3][2] = ck[3][3] = ck[3][4] = ck[3][5] = true; for (int k = 3; k < n; k *= 2) tristar(k); for (int i = 1; i
#include #include using namespace std; int N,M,arr[5000]; bool check(int s){ int mini = arr[0],maxi = arr[0],section=1; for(int i= 1; i s) mini = maxi = arr[i],section++; } return section
#include #include #include #include using namespace std; vector v[10001]; int visited[10001]; int finished[10001]; bool dfs(int x){ bool flag = true; visited[x] = 1; for(int nx : v[x]){ if(!visited[nx]) flag = dfs(nx); if(flag == false) break; else if(finished[nx] == 0) return false; } finished[x] = 1; return flag; } int main(){ ios_base::sync_with_stdio(0); int n; cin >> n; map m; for(int i=0 ;..
#include #include #include using namespace std; int main(){ ios_base::sync_with_stdio(0); int n; priority_queue q; cin >> n; for(int i=0,x ;i> x; if(!x){ cout