Share Code Quickly

What is Harigami?

Harigami is a simple source code sharing service. You can share source code by an URL which is issued after submission.
You can also run your source code online such as Python, Ruby, JavaScript and so on.
For free.Use for code review.
Preferences
12317318319
anonymous No title
Python
stdin = list(map(int, input().split()))

print(int((stdin[0]*3+stdin[1]) / 2))
anonymous No title
Python
# wrong
class MyDataParallel(nn.DataParallel):
    def __getattr__(self, name):
        return getattr(self.module, name)

# correct
class MyDataParallel(DataParallel):
    def __getattr__(self, name):
        if name is not 'module':
            try:
                return getattr(self.module, name)
            except AttributeError:
                pass
        print(name)
        return super(nn.DataParallel, self).__getattr__(name)
anonymous No title
JavaScript
a = {}
a.bbb = "ccc"
レイヤくん(麻木澪夜)@れもネコ🍋🐱ぐみ Are you seeker?
GPL v2 Skript
broadcast "Are you seeker?"
anonymous No title
Python
print('harigami')
anonymous No title
Python
print("Teriyaki")
anonymous 新しいHarigamiにようこそ。
Python
print('Welcome  to Harigami!')
anonymous ナップサック問題書き直し
C++
#include <iostream>
#include <algorithm>
using namespace std;

const int n=6, W=8;
const int w[n] = {2,1,3,2,1,5}, v[n]={3,2,6,1,3,85};

int dp[10][10];

int rec(int i, int cap) {
    if (dp[i][cap] != -1) {
        return dp[i][cap];
    }

    int res;
    if (i == n) {
        res = 0;
    } else if (cap < w[i]) {
        res = rec(i + 1, cap);
    } else {
        res = max(
            rec(i + 1, cap),
            rec(i + 1, cap - w[i]) + v[i]
        );
    }
    return dp[i][cap] = res;
}

int main() {
    memset(dp, -1, sizeof(dp));
    cout << rec(0, W) << endl;
}
12317318319