提出 #49499548


ソースコード 拡げる

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less_equal<int>,rb_tree_tag, tree_order_statistics_node_update>oset; 
#define hi cout << "test\n" ;/////
const int mod = 1e9 + 7 ;
#define sp(x) fixed<<setprecision(x)
#define  ll unsigned long long
const ll INF = 1e18 ; 
#define FastIO ios_base::sync_with_stdio(false) , cin.tie(0) , cout.tie(0)
#ifndef ONLINE_JUDGE
#define dbg(x) cerr << #x <<" = "; _print(x); cerr << endl;
#else
#define dbg(x)
#endif
ll binpow(ll a, ll b) {if (b == 0)return 1; ll res = binpow(a, b / 2);if (b % 2) return res * res * a;else return res * res;}
ll expo(ll a, ll b, ll mod) {ll ans = 1; while (b > 0) {if (b & 1)ans = (ans * a) % mod; a = (a * a) % mod; b = b >> 1;} return ans;}
ll gcd(ll a, ll b) { return((b == 0) ? a : gcd(b, a % b)); }
ll lcm(ll a, ll b) { return (b / gcd(a, b)) * a; }
void _print(auto t) {cerr << t;}
template <class T, class V> void _print(pair <T, V> p);
template <class T> void _print(vector <T> v);
template <class T> void _print(deque <T> v);
template <class T> void _print(set <T> v);
template <class T, class V> void _print(map <T, V> v);
template <class T> void _print(multiset <T> v);
template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.first); cerr << ","; _print(p.second); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " "; } cerr << "]";}
template <class T> void _print(deque <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " "; } cerr << "]";}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}
template < typename T > void output (const vector<T> & vec ){  for(auto elem : vec) cout<<elem<<" ";cout <<"" ;}
//--------------------------------------------------------------- ------------------------------------------------------------------- 
#define int long long 
void solve(){
 
     int n ; cin >> n ; 
     
     int start = 1 , end = n ; 
     while ( true ) {
       
          cout << 2 << endl;
          cout << flush ; 
          
          vector < int > a , b ; 
          for ( int i = start ; i <= end ; i++ ){
              if ( i <= ( start + end )  / 2 ) a.push_back( i ) ; 
              else b.push_back( i );
          }

          cout << a.size() << endl;
          cout << flush;

          for ( auto &x : a ) {
            cout << x << endl; 
            cout << flush ; 
          }

          cout << b.size() << endl;
          cout << flush;

          for ( auto &x : b ) {
            cout << x << endl; 
            cout << flush ; 
          }

          string s ; cin >> s ; 

          if ( s[0] == '1' ) {

               if ( a.size() == 1 ) {
                  cout << a[0] << endl; 
                  cout << flush ; 
                  break;
               }

             start = a[0] ; 
             end = a.back();
          }
          else {
              
              if ( b.size() == 1 ){
                cout << b[0] << endl; 
                cout << flush ; 
                break;
              }       
            
              start = b[0] ;
              end = b.back();
          }

     }

}
//---------------------------------------------------------------------------------------------------------------------------------
int32_t main(){
 #ifndef ONLINE_JUDGE
    freopen("error.txt","w",stderr) ;
 #endif 
    
 
    

     FastIO ;
     int test = 1;
     int TestCases = 0  ; 

     if ( TestCases )
             cin>>test; 

     while(test--){
     solve(); 
      if(test>0)
        cout << endl; 
     }
 
 }      

提出情報

提出日時
問題 E - Bad Juice
ユーザ Moorit
言語 C++ 20 (gcc 12.2)
得点 0
コード長 4065 Byte
結果 WA
実行時間 3 ms
メモリ 3860 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 425
結果
WA × 1
WA × 26
セット名 テストケース
Sample example0.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, example0.txt
ケース名 結果 実行時間 メモリ
000.txt WA 3 ms 3652 KiB
001.txt WA 2 ms 3764 KiB
002.txt WA 2 ms 3768 KiB
003.txt WA 2 ms 3804 KiB
004.txt WA 2 ms 3716 KiB
005.txt WA 2 ms 3720 KiB
006.txt WA 2 ms 3652 KiB
007.txt WA 2 ms 3768 KiB
008.txt WA 2 ms 3776 KiB
009.txt WA 3 ms 3664 KiB
010.txt WA 2 ms 3764 KiB
011.txt WA 2 ms 3832 KiB
012.txt WA 2 ms 3664 KiB
013.txt WA 2 ms 3768 KiB
014.txt WA 2 ms 3776 KiB
015.txt WA 2 ms 3660 KiB
016.txt WA 2 ms 3660 KiB
017.txt WA 3 ms 3644 KiB
018.txt WA 2 ms 3708 KiB
019.txt WA 2 ms 3720 KiB
020.txt WA 2 ms 3860 KiB
021.txt WA 2 ms 3732 KiB
022.txt WA 2 ms 3760 KiB
023.txt WA 2 ms 3716 KiB
024.txt WA 2 ms 3768 KiB
example0.txt WA 2 ms 3820 KiB