結果
問題 | No.942 プレゼント配り |
ユーザー |
![]() |
提出日時 | 2020-03-31 23:02:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 567 bytes |
コンパイル時間 | 1,130 ms |
コンパイル使用メモリ | 63,872 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 12:28:49 |
合計ジャッジ時間 | 3,146 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 WA * 6 |
ソースコード
#include <iostream> using namespace std; // N <= 2 * 10^5 int main(){ int n,k; cin >> n >> k; if(n%k > 0){ cout << "No" << endl; return 0; } int m = n / k; if(m % 2 == 1){ cout << "No" << endl; return 0; } const int t = m / 2; cout << "Yes" << endl; for(int i=0;i<k;i++){ const int s = 1 + t * i; for(int j=0;j<t;j++){ cout << s + j << " "; } const int e = n - t * i; for(int j=0;j<t;j++){ cout << e - j << endl; } } }