結果
問題 |
No.2357 Guess the Function
|
ユーザー |
![]() |
提出日時 | 2023-06-23 21:36:18 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,112 bytes |
コンパイル時間 | 4,238 ms |
コンパイル使用メモリ | 256,748 KB |
最終ジャッジ日時 | 2025-02-15 00:40:14 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 6 WA * 4 |
ソースコード
#include <stdio.h> #include <atcoder/all> #include <bits/stdc++.h> using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 int query(int y){ cout<<"? "<<y<<endl; int r; cin>>r; return r; } int answer(int x,int y){ cout<<"! "<<x<<' '<<y<<endl; exit(0); } int is_unique(int x,int y){ map<pair<int,int>,pair<int,int>> mp; int c = 0; rep(i,101){ for(int j=i+1;j<=100;j++){ mp[make_pair((i+x)%j, (i+y)%j)] = make_pair(i,j); c++; } } return mp.size(); /* cout<<c<<','<<mp.size()<<endl; if(c!=mp.size())return false; return true; */ } int main(){ int x = query(1); int y = query(100); rep(i,101){ for(int j=i+1;j<=100;j++){ if((i+1)%j==x&&(i+100)%j==y){ answer(i,j); } } } /* int t = 0; for(int i=1;i<=100;i++){ for(int j=i+1;j<=100;j++){ int r =is_unique(i,j); if(r>t){ t = r; cout<<r<<','<<i<<','<<j<<endl; } } } */ /* int A,B; int t = query(1); if(t==0){ } else{ A = t-1; } */ return 0; }