Skip to content

Instantly share code, notes, and snippets.

View baactree's full-sized avatar

Seonjun Park baactree

View GitHub Profile
@baactree
baactree / a+b-6.cpp
Last active November 12, 2017 08:31
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int TestCase;
scanf("%d", &TestCase);
while(TestCase--){
int a, b;
scanf("%d,%d", &a, &b);
printf("%d\n", a+b);
@baactree
baactree / a+b-4.cpp
Last active November 12, 2017 08:31
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int a, b;
while(scanf("%d%d", &a, &b)!=EOF)
printf("%d\n", a+b);
return 0;
}
@baactree
baactree / a+b-3.cpp
Last active November 12, 2017 08:30
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int TestCase;
cin>>TestCase;
while(TestCase--){
int a, b;
cin>>a>>b;
cout<<a+b<<endl;
#include <iostream>
using namespace std;
int main(){
int a, b;
cin>>a>>b;
cout<<a+b<<endl;
return 0;
}
// 1. O(log(n))
while(n)
n/=2;
// 2. O(sqrt(n))
for(int i=0;i*i<=n;i++);
// 3. O(n)
for(int i=0;i<n;i++);
#include <bits/stdc++.h>
using namespace std;
int dist[101][101];
int n, m, k, p;
int main(){
int TestCase;
scanf("%d", &TestCase);
for(int tc=1;tc<=TestCase;tc++){
scanf("%d%d%d", &n, &m, &k);
memset(dist, 0x3f, sizeof(dist));
#include <bits/stdc++.h>
using namespace std;
int n, s;
int arr[100000];
int main(){
int TestCase;
scanf("%d", &TestCase);
for(int tc=1;tc<=TestCase;tc++){
scanf("%d%d", &n, &s);
for(int i=0;i<n;i++)
#include <bits/stdc++.h>
using namespace std;
const int INF=0x3f3f3f3f;
int N;
int cache[2501][51];
int b[51];
vector<pair<int, int> > dish;
int solve(int idx,int front) {
if (idx == dish.size())
#include <bits/stdc++.h>
using namespace std;
int n, m;
int x, y;
int k;
int mat[20][20];
// 1 2 3 4 5 6
int dice[7]={0, 0, 0, 0, 0, 0, 0};
int dx[4]={0, 0, -1, 1};
int dy[4]={1, -1, 0, 0};
#include <bits/stdc++.h>
using namespace std;
int main(){
int TestCase;
scanf("%d", &TestCase);
for(int tc=1;tc<=TestCase;tc++){
int n, m;
scanf("%d%d", &n, &m);
vector<int> arr(n);
for(int i=0;i<n;i++)