結果
| 問題 |
No.2622 Dam
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-09 22:19:39 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 478 bytes |
| コンパイル時間 | 1,727 ms |
| コンパイル使用メモリ | 190,548 KB |
| 最終ジャッジ日時 | 2025-02-19 03:47:58 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve();
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int test_case;
cin>>test_case;
while (test_case--){
solve();
}
}
void solve(){
ll X,V,IN,OUT,Q,R;
cin>>V>>X>>OUT>>IN>>Q>>R;
if(X+(IN-OUT)*R>V){
cout<<"Overflow\n";
return;
}
ll cyc=IN*R-OUT*Q;
if(cyc==0){
cout<<"Safe\n";
}else if(cyc>0){
cout<<"Overflow\n";
}else{
cout<<"Zero\n";
}
}