結果

問題 No.3054 ほぼ直角二等辺三角形
ユーザー merom686merom686
提出日時 2019-04-01 22:58:53
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,883 bytes
コンパイル時間 617 ms
コンパイル使用メモリ 73,656 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-05 08:42:02
合計ジャッジ時間 1,717 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:13:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   13 |         "3 4 5",
      |         ^~~~~~~
main.cpp:14:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   14 |         "20 21 29",
      |         ^~~~~~~~~~
main.cpp:15:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   15 |         "119 120 169",
      |         ^~~~~~~~~~~~~
main.cpp:16:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   16 |         "4059 4060 5741",
      |         ^~~~~~~~~~~~~~~~
main.cpp:17:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   17 |         "23660 23661 33461",
      |         ^~~~~~~~~~~~~~~~~~~
main.cpp:18:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   18 |         "137903 137904 195025",
      |         ^~~~~~~~~~~~~~~~~~~~~~
main.cpp:19:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   19 |         "4684659 4684660 6625109",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:20:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   20 |         "27304196 27304197 38613965",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:21:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   21 |         "159140519 159140520 225058681",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:22:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   22 |         "5406093003 5406093004 7645370045",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:23:9: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   23 |         "31509019100 31509019101 44560482149",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:24:9: wa

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

int main() {
    char *s[18] = {
        "3 4 5",
        "20 21 29",
        "119 120 169",
        "4059 4060 5741",
        "23660 23661 33461",
        "137903 137904 195025",
        "4684659 4684660 6625109",
        "27304196 27304197 38613965",
        "159140519 159140520 225058681",
        "5406093003 5406093004 7645370045",
        "31509019100 31509019101 44560482149",
        "183648021599 183648021600 259717522849",
        "1070379110496 1070379110497 1513744654945",
        "36361380737780 36361380737781 51422757785981",
        "211929657785303 211929657785304 299713796309065",
        "1235216565974040 1235216565974041 1746860020068409",
        "41961001862379596 41961001862379597 59341817924539925",
        "244566641436218639 244566641436218640 345869461223138161",
    };
    int x;
    cin >> x;
    cout << s[x - 1] << endl;

    //for (int i = 2; i < 100; i++) {
    //    for (int j = -2; j < 3; j++) {
    //        int n = i, t = n * sqrt(2), m = t + n;
    //        int a = m * m - n * n, b = 2 * m * n, c = m * m + n * n;
    //        cout << a << ' ' << b << ' ' << c << endl;
    //        cout << a - b << endl;
    //    }
    //    cout << endl;
    //}
    //for (ll i = 1; ; i++) {
    //    int k = i / (sqrt(2) + 1);
    //    for (ll j = -2; j <= 2; j++) {
    //        ll m = i, n = j + k;
    //        ll a = m * m - n * n, b = 2 * m * n, c = m * m + n * n;
    //        if (abs(a - b) == 1) {
    //            if (a > b) swap(a, b);
    //            //cout << i << ' ' << j << endl;
    //            cout << a << ' ' << b << ' ' << c << endl;
    //            //cout << (double)m / n << endl;
    //        }
    //    }
    //}

    return 0;
}
0