結果
問題 | No.253 ロウソクの長さ |
ユーザー | kyuridenamida |
提出日時 | 2015-07-24 23:43:02 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,936 bytes |
コンパイル時間 | 1,525 ms |
コンパイル使用メモリ | 162,100 KB |
実行使用メモリ | 25,476 KB |
平均クエリ数 | 53.83 |
最終ジャッジ日時 | 2024-07-16 05:03:08 |
合計ジャッジ時間 | 5,298 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 24 ms
24,940 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 22 ms
24,580 KB |
testcase_07 | AC | 22 ms
24,964 KB |
testcase_08 | AC | 21 ms
24,952 KB |
testcase_09 | WA | - |
testcase_10 | AC | 21 ms
25,220 KB |
testcase_11 | AC | 22 ms
24,964 KB |
testcase_12 | AC | 21 ms
24,580 KB |
testcase_13 | AC | 21 ms
25,220 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 20 ms
25,220 KB |
testcase_17 | AC | 21 ms
25,220 KB |
testcase_18 | AC | 21 ms
25,220 KB |
testcase_19 | AC | 22 ms
25,220 KB |
testcase_20 | AC | 21 ms
24,964 KB |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 21 ms
25,220 KB |
testcase_24 | WA | - |
testcase_25 | AC | 21 ms
24,952 KB |
testcase_26 | AC | 21 ms
24,964 KB |
testcase_27 | AC | 23 ms
25,220 KB |
testcase_28 | AC | 22 ms
24,836 KB |
testcase_29 | AC | 21 ms
24,964 KB |
testcase_30 | AC | 23 ms
24,964 KB |
testcase_31 | AC | 22 ms
24,580 KB |
testcase_32 | AC | 24 ms
24,836 KB |
testcase_33 | AC | 23 ms
25,348 KB |
testcase_34 | WA | - |
testcase_35 | AC | 23 ms
24,580 KB |
ソースコード
#include <bits/stdc++.h>using namespace std;long long gcd(long long a,long long b){return b ? gcd(b,a%b) : a;}long long lcm(long long a,long long b){return a / gcd(a,b) * b;}long long mul(long long a,long long b,const long long mod){return b?(mul(a*2,b/2,mod)+(b&1?a:0))%mod:0;}long long bpow(long long a,long long b,const long long mod){return (b?bpow(a*a%mod,b/2,mod)*(b&1?a:1):1)%mod;}long long inv(long long a,const long long mod){return bpow(a,mod-2,mod);}// to overflow/*long long bpow(long long a,long long b,const long long mod){return (b?mul(bpow(mul(a,a,mod),b/2,mod),(b&1?a:1),mod):1)%mod;}*/class mInt{public:static const long long mod = 1000000007;long long v;mInt():v(0){}mInt(long long v):v((v%mod+mod)%mod){}};mInt& operator += (mInt &a,mInt b){ return a = a.v + b.v; }mInt& operator -= (mInt &a,mInt b){ return a = a.v - b.v; }mInt& operator *= (mInt &a,mInt b){ return a = a.v * b.v; }mInt& operator /= (mInt &a,mInt b){ return a = a.v * inv(b.v,mInt::mod); }mInt operator + (mInt a,mInt b){ return a += b; }mInt operator - (mInt a,mInt b){ return a -= b; }mInt operator * (mInt a,mInt b){ return a *= b; }mInt operator / (mInt a,mInt b){ return a /= b; }ostream& operator<<(ostream& os, const mInt& x){ return os << x.v; }double ncr1[4000][4000];long long ncr2[4000][4000];long long nHr(int n,int r){int a = n + r - 1;int b = r-1;if( ncr1[a][b] > 1e17 ) return 1e17;return ncr2[a][b];}int Q(int n){cout << "? " << n << endl;string s1;int ans;cin >> ans;return ans;}int D(int a){cout << "! " << a << endl;exit(0);}int main(){int T = 0;T++;if( Q(100) == -1 ){for(int i = 0 ; i < 100 ; i++ ){int t = Q(i);if( t == 0 ) D(i+T);T++;}}else{int l = 0 , r = 1e9;while( l != r ){int m = (l+r+1) / 2;if( Q(m-T) == -1 ){ // Y < (?)r = m-1;}else{l = m;}T++;}D(l);}}