結果

問題 No.1523 +/- Tree
ユーザー kotatsugamekotatsugame
提出日時 2021-05-28 21:07:47
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 523 ms
コンパイル使用メモリ 63,488 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 08:39:03
合計ジャッジ時間 6,396 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 14 WA * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int N,K;
main()
{
	cin>>N>>K;
	int pos=(N-1+K-1)/K;
	int neg=N-1-pos;
	int b=K-1;
	if(b*pos-neg>0)
	{
		cout<<"Yes"<<endl;
		for(int i=0;i<N-1;i++)
		{
			cout<<i+1<<" "<<i+2<<" ";
			if(i%K==0)cout<<b<<endl;
			else cout<<-1<<endl;
		}
	}
	else cout<<"No"<<endl;
}
0