結果
問題 |
No.1440 The Quiz Competition
|
ユーザー |
|
提出日時 | 2021-03-26 21:40:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 426 bytes |
コンパイル時間 | 642 ms |
コンパイル使用メモリ | 64,580 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-28 22:20:31 |
合計ジャッジ時間 | 1,596 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 6 WA * 21 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; int T; main() { cin>>T; for(;T--;) { int N,A,W,K; cin>>N>>A>>W>>K; if(N>K) { if(K-1<=A) { cout<<(A-(K-1))/K<<endl; } else if(N-K+1<=W) { cout<<-1<<endl; } else { cout<<":("<<endl; } } else { long S=A; long T=W/N; S-=T*(T+1)/2*N; S-=(T+1)*(W%N); S-=N-1; long s=S/N; while(s*N>S)s--; cout<<s<<endl; } } }