結果

問題 No.942 プレゼント配り
ユーザー ngtkanangtkana
提出日時 2020-04-14 23:39:24
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 636 bytes
コンパイル時間 2,368 ms
コンパイル使用メモリ 195,708 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-09 18:23:05
合計ジャッジ時間 4,294 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 14 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 14 ms
6,940 KB
testcase_05 WA -
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 11 ms
6,940 KB
testcase_09 AC 12 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
using lint=long long;
using ld=long double;
template<class T>using numr=std::numeric_limits<T>;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint n,k;std::cin>>n>>k;
    lint l=n/k;
    if(l%2){
        std::cout<<"No"<<'\n';
        return 0;
    }
    std::cout<<"Yes"<<'\n';
    l/=2;
    for(lint i=0,j=0;i<k;i++){
        for(;j<(i+1)*l;j++){
            std::cout<<(j==i*l?"":" ")<<j+1;
            std::cout<<' '<<n-j;
        }
        std::cout<<'\n';
    }
}
0