結果
問題 |
No.355 数当てゲーム(2)
|
ユーザー |
|
提出日時 | 2016-04-16 04:41:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 605 bytes |
コンパイル時間 | 1,348 ms |
コンパイル使用メモリ | 167,708 KB |
実行使用メモリ | 25,820 KB |
平均クエリ数 | 40.00 |
最終ジャッジ日時 | 2024-07-16 09:56:44 |
合計ジャッジ時間 | 12,469 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 52 |
ソースコード
#include <bits/stdc++.h> using namespace std; int num[] = { 0,0,0,0 }; pair<int, int>check() { cout << num[0] << " " << num[1] << " " << num[2] << " " << num[3] << endl; pair<int, int>ret; cin >> ret.first >> ret.second; if( ret.first == 4 && ret.second == 0 ) { exit; } return ret; } int main() { for( size_t j = 0; j < 4; j++ ) { pair <int, int>memo; int ansnum = 0; for( size_t i = 0; i < 10; i++ ) { num[j] = i; auto xx = check(); if( memo.first + memo.second < xx.first + xx.second || memo.first < xx.first ) { memo = xx; ansnum = i; } } num[j]=ansnum; } }