結果
問題 | No.522 Make Test Cases(テストケースを作る) |
ユーザー |
|
提出日時 | 2017-06-18 14:28:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 141 ms / 2,000 ms |
コード長 | 277 bytes |
コンパイル時間 | 714 ms |
コンパイル使用メモリ | 57,468 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-01 19:58:51 |
合計ジャッジ時間 | 4,341 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:15: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | int n; scanf("%d", &n); | ~~~~~^~~~~~~~~~
ソースコード
#include <iostream> #include <algorithm> using namespace std; int main(void) { int n; scanf("%d", &n); for(int a=1; a<n; ++a) { for(int b=a; b<n; ++b) { int c = n - a - b; if(b <= c) { printf("%d %d %d\n", a, b, c); } } } return 0; }