結果
問題 | No.143 豆 |
ユーザー | pekempey |
提出日時 | 2019-09-26 02:20:45 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,795 bytes |
コンパイル時間 | 851 ms |
コンパイル使用メモリ | 72,892 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-30 17:39:49 |
合計ジャッジ時間 | 1,521 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,376 KB |
testcase_01 | AC | 2 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,376 KB |
testcase_03 | AC | 1 ms
4,376 KB |
testcase_04 | AC | 2 ms
4,380 KB |
testcase_05 | AC | 2 ms
4,376 KB |
testcase_06 | AC | 2 ms
4,376 KB |
testcase_07 | AC | 1 ms
4,380 KB |
testcase_08 | AC | 2 ms
4,376 KB |
testcase_09 | AC | 2 ms
4,380 KB |
testcase_10 | AC | 2 ms
4,376 KB |
testcase_11 | AC | 2 ms
4,376 KB |
testcase_12 | AC | 1 ms
4,376 KB |
testcase_13 | AC | 1 ms
4,376 KB |
testcase_14 | AC | 2 ms
4,376 KB |
testcase_15 | AC | 1 ms
4,380 KB |
testcase_16 | AC | 2 ms
4,380 KB |
ソースコード
// https://github.com/pekempey/banana // ------------------------------------------- // let K = readint () in // let N = readint () in // let F = readint () in // let A = vecint F in // for i = 0 to F - 1 do // A[i] = readint () // done; // if sum A > K * N then // println "-1" // else // println (K * N - sum A) // ------------------------------------------- #include <iostream> #include <algorithm> #include <vector> #include <string> template<class T> int print(T a) { std::cout << a << ' '; return 0; } template<class T> int println(T a) { std::cout << a << '\n'; return 0; } int print_newline(int dummy) { std::cout << '\n'; return 0; } long long readint(int dummy) { long long a; std::cin >> a; return a; } std::string readstr(int dummy) { std::string a; std::cin >> a; return a; } std::vector<long long> vecint(long long n) { return std::vector<long long>(n, 0); } long long sum(std::vector<long long> a) { long long res = 0; for (long long x : a) res += x; return res; } int main() { long long _11=0; auto _12=readint(_11); auto _5=_12; long long _13=0; auto _14=readint(_13); auto _6=_14; long long _15=0; auto _16=readint(_15); auto _7=_16; auto &_17=_7; auto _18=vecint(_17); auto _8=_18; long long _19=0; auto &_20=_7; long long _21=1; auto _22=_20-_21; for(int _9=_19;_9<=_22;_9++){ auto &_23=_8; auto &_24=_9; auto &_25=_23[_24]; long long _26=0; auto _27=readint(_26); _25=_27; } auto _28=0; auto &_29=_8; auto _30=sum(_29); auto &_31=_5; auto &_32=_6; auto _33=_31*_32; auto _34=_30>_33; int _44; if(_34){ std::string _35="-1"; auto _36=println(_35); _44=_36; } else { auto &_37=_5; auto &_38=_6; auto _39=_37*_38; auto &_40=_8; auto _41=sum(_40); auto _42=_39-_41; auto _43=println(_42); _44=_43; } auto _45=_44; auto _46=_45; auto _47=_46; auto _48=_47; auto _49=_48; }