목록 Categories (93)
Deep Learning study
#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 #include using namespace std; bool cmp(const pair &a,const pair &b){ if(a.first == b.first){ return a.second > b.second; } return a.first > n; vector a(n); for(int i=0 ;i> a[i].first >> a[i].second; sort(a.begin(),a.end(),cmp); cin >> m; vector b(m); for(int i=0 ;i> b[i].first >> b[i].second; sort(b.begin(),b...
#include #include int max(int a){ int ret=0,i=0; while(a){ if((a%10) == 5) ret += 6*(int)pow(10,i); else ret+=(a%10) * (int)pow(10,i); a/=10,i++; } return ret; } int min(int a){ int ret=0,i=0; while(a){ if((a%10) == 6) ret += 5*(int)pow(10,i); else ret+=(a%10) * (int)pow(10,i); a/=10,i++; } return ret; } int main(){ int a,b; scanf("%d %d",&a,&b); printf("%d %d\n",min(a)+min(b),max(a)+max(b)); re..
#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 using namespace std; #define INF 1e9 int d[100][100]; int v[100][100]; int main(){ ios_base::sync_with_stdio(0); int n,m; cin >> n >> m; for(int i=0 ;i> b >> c; if(d[a-1][b-1] > c) d[a-1][b-1] = c,v[a-1][b-1] = b-1; } for(int k=0 ;k
#include using namespace std; const int MAX_V = 502; const int S = 500; const int E = 501; const int INF = (1 0){ f[cur][next] += df; f[next][cur] -= df; return df; } } } return 0; } int main(){ ios_base::sync_with_stdio(false); int N; cin >> N; for(int i=0 ;i> where; if(where == 1){ c[S][i] = INF; adj[i].push_back(S); adj[S].push_back(i); } else if(where == 2){ c[i][E] = INF; adj[i].push_back(E..
#include #include #include #include using namespace std; struct student{ int kor,math,eng; string name; }; bool cmp(const student &v,const student &s){ return make_tuple(-v.kor,v.eng,-v.math,v.name) > n; vector stu(n); for(int i=0 ;i> stu[i].name >> stu[i].kor >> stu[i].eng >> stu[i].math; sort..
#include #include #include #include using namespace std; struct student{ int kor,math,eng; string name; bool operator s.kor) return true; else if(kor == s.kor){ if(eng s.math) return true; else if(math == s.math) return name > n; vector stu(n); for(int i=0 ;i> stu[i].name >> stu[i].kor >> stu[i].eng >> stu..