結果

問題 No.2420 Simple Problem
ユーザー WRWR
提出日時 2023-08-12 15:02:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,128 bytes
コンパイル時間 1,878 ms
コンパイル使用メモリ 190,644 KB
実行使用メモリ 7,808 KB
最終ジャッジ日時 2024-04-30 07:52:44
合計ジャッジ時間 23,597 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 282 ms
6,940 KB
testcase_02 AC 4 ms
6,944 KB
testcase_03 AC 105 ms
6,944 KB
testcase_04 AC 533 ms
6,944 KB
testcase_05 AC 340 ms
6,940 KB
testcase_06 AC 697 ms
7,552 KB
testcase_07 AC 671 ms
7,680 KB
testcase_08 AC 699 ms
7,424 KB
testcase_09 AC 680 ms
7,552 KB
testcase_10 AC 672 ms
7,680 KB
testcase_11 AC 694 ms
7,680 KB
testcase_12 AC 670 ms
7,680 KB
testcase_13 AC 680 ms
7,680 KB
testcase_14 AC 703 ms
7,680 KB
testcase_15 AC 685 ms
7,680 KB
testcase_16 AC 693 ms
7,424 KB
testcase_17 AC 663 ms
7,680 KB
testcase_18 AC 686 ms
7,680 KB
testcase_19 AC 679 ms
7,552 KB
testcase_20 AC 667 ms
7,552 KB
testcase_21 AC 668 ms
7,680 KB
testcase_22 AC 712 ms
7,424 KB
testcase_23 AC 773 ms
7,552 KB
testcase_24 AC 681 ms
7,808 KB
testcase_25 AC 688 ms
7,680 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 2 ms
6,940 KB
testcase_33 AC 280 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<typename T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}else{return false;}}
template<typename T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}else{return false;}}
/* ASCII
[0:48],[1:49],[2:50],[3:51],[4:52],[5:53],[6:54],[7:55],[8:56],[9:57],
[A:65],[B:66],[C:67],[D:68],[E:69],[F:70],[G:71],[H:72],[I:73],[J:74],[K:75],[L:76],[M:77],
[N:78],[O:79],[P:80],[Q:81],[R:82],[S:83],[T:84],[U:85],[V:86],[W:87],[X:88],[Y:89],[Z:90],
[a:97],[b:98],[c:99],[d:100],[e:101],[f:102],[g:103],[h:104],[i:105],[j:106],[k:107],[l:108],[m:109],
[n:110],[o:111],[p:112],[q:113],[r:114],[s:115],[t:116],[u:117],[v:118],[w:119],[x:120],[y:121],[z:122]
*/


int main(void){
    int N; cin >> N;
    vector<double> A(N, 0);
    vector<double> B(N, 0);
    for(int i = 0; i < N; i++){
        cin >> A[i] >> B[i];
    }
    for(int i = 0; i < N; i++){
        double R = pow(A[i], 0.5) + pow(B[i], 0.5);
        if(R = (int)R){
            cout << R + 1 << endl;
        } else {
            cout << ceil(R) << endl;
        }
    }
}
0