結果
| 問題 | No.942 プレゼント配り |
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-04-14 23:39:24 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 636 bytes |
| 記録 | |
| コンパイル時間 | 2,881 ms |
| コンパイル使用メモリ | 191,844 KB |
| 最終ジャッジ日時 | 2025-01-09 19:12:05 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 WA * 6 |
ソースコード
#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';
}
}
ngtkana