多くの9.1の筆記試験の事前承認を行います.

6750 ワード

タイトル:http://mrw.so/6tsmXx 1.米字マトリクスをプリントします.負の量を持つ0 1バックパック(勉強しました.負の体積を先に入れて、全体のボリュームを拡大します.総収益の起点はansです.負の体積に遭遇したものは取り出しに相当します.収益はその逆の数を増加します.例えば、収益は-1を取り出します.+1に相当します.)int ju[201][201],temp;struct pos{int x,y;}book iflegal(intx,int y){return x>=0&x=0&y法2萼include using namespace std;
const int N=210
int n;int a[N][N];
int main(){cin>>n
for (int i = 0; i < n; i ++ )
    for (int j = 0; j < n; j ++ ) {
        if (i == j || i + j == n - 1 || (n & 1) && (i == n >> 1 || j == n >> 1)) continue;
        else {
            if (i < n >> 1) {
                if (j < n >> 1) {
                    if (i > j) a[i][j] = 3;
                    else a[i][j] = 2;
                } else {
                    if (i + j >= n) a[i][j] = 8;
                    else a[i][j] = 1;
                }
            } else {
                if (j < n >> 1) {
                    if (i + j >= n) a[i][j] = 5;
                    else a[i][j] = 4;
                } else {
                    if (i > j) a[i][j] = 6;
                    else a[i][j] = 7;
                }
            }
        }
    }

for (int i = 0; i < n; i ++ ) {
    for (int j = 0; j < n; j ++ ) cout << a[i][j] << ' ';
    puts("");
}

return 0;
)
作者:xnuohzリンク:https://www.acwing.com/blog/content/3740/ソース:AcWing著作権は著者の所有になります.商業転載は著者に連絡して許可を得てください.商業転載ではないので、出典を明記してください.3.菗include using namespace std;const int maxn=410;int[maxn]、v[maxn];int dp[40091;man];man(){N、“%1]、“%i=”scanf(“%d%d%d]、&c[i]、&v[i]);if(c[i]===0){/負の物体は逆ans+=v[i];M=c[i]==-c[i];v[i]===-v[i]]]正正(int=i=1;i=i=i=i====================N+i""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""+v[i];
for(int i=0;i<=M;i++) {
        dp[M]=max(dp[M],dp[i]);
}
printf("%d
",ans+dp[M]); return 0;
}2.移動兵士は、最大グループを獲得した(分かりませんでした.先にコードを入れます.)https://www.nowcoder.com/discuss/495682?type=post&order=time&pos=&page=1&channel=666&source_id=search_post 癜include萼include葃include using namespace std;book shibing[400];int shibing[400];struct pos{int x,y;
};int d[2]、[4]={{-1,0,1,0,1,0,-1};int num[400*400];bol num c c[400*400];int n,m;bol iLegal(intx,int){returnx>=0&x&xint main(){int cnt=0、alll=0;memset(shibingS、-1、sizeof(shibingS)cin>n>>>m;for(inti=0;i+){for(intj=0;jShbing[i]、[j]“““"""""""""""""""""""""""""""""""""""""""""""=="""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""nt);ans=max(ans,num[cnt];alll+=num[cnt];queueque;/for(int i=0;i<n;i++){/for(intj=0;j<m;j++){/cout<