Submission #683867

# Submission time Handle Problem Language Result Execution time Memory
683867 2023-01-19T14:05:57 Z victor_gao Furniture (JOI20_furniture) C++17
0 / 100
8 ms 944 KB
#pragma GCC optimize("Ofast,unroll-loops,O3")
#pragma GCC optimize("avx,avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,fma,tune=native")
#include<bits/stdc++.h>
//#include<bits/extc++.h>
//#pragma pack(1)
#define fast ios::sync_with_stdio(0); cin.tie(0);
#define pii pair<int,int>
#define x first
#define y second
#define N 1005
using namespace std;
//using namespace __gnu_pbds;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//typedef tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update> order_multiset;
//typedef tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> order_set;
set<int>st[N];
int n,m,arr[N][N];
signed main(){
    fast
    cin>>n>>m;
    for (int i=1;i<=n;i++){
        for (int j=1;j<=m;j++){
            cin>>arr[i][j];
            if (arr[i][j])
                st[i].insert(j);
        }
        st[i].insert(m+1);
    }
    int q; cin>>q;
    while (q--){
        int x,y,ok=0; cin>>x>>y;
        st[x].insert(y);
        int now=*st[1].begin();
        for (int i=2;i<=n;i++)
            now=*(st[i].upper_bound(now-2));
        if (now<=m){
            cout<<0<<'\n';
            st[x].erase(y);
        }
        else cout<<1<<'\n';
    }
}

Compilation message

furniture.cpp:2:88: warning: bad option '-favx' to pragma 'optimize' [-Wpragmas]
    2 | #pragma GCC optimize("avx,avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,fma,tune=native")
      |                                                                                        ^
furniture.cpp:2:88: warning: bad option '-favx2' to pragma 'optimize' [-Wpragmas]
furniture.cpp:2:88: warning: bad option '-fsse' to pragma 'optimize' [-Wpragmas]
furniture.cpp:2:88: warning: bad option '-fsse2' to pragma 'optimize' [-Wpragmas]
furniture.cpp:2:88: warning: bad option '-fsse3' to pragma 'optimize' [-Wpragmas]
furniture.cpp:2:88: warning: bad option '-fssse3' to pragma 'optimize' [-Wpragmas]
furniture.cpp:2:88: warning: bad option '-fsse4' to pragma 'optimize' [-Wpragmas]
furniture.cpp:2:88: warning: bad option '-fpopcnt' to pragma 'optimize' [-Wpragmas]
furniture.cpp:2:88: warning: bad option '-fabm' to pragma 'optimize' [-Wpragmas]
furniture.cpp:2:88: warning: bad option '-fmmx' to pragma 'optimize' [-Wpragmas]
furniture.cpp:2:88: warning: bad option '-ffma' to pragma 'optimize' [-Wpragmas]
furniture.cpp:2:88: warning: bad option '-ftune=native' to pragma 'optimize' [-Wpragmas]
furniture.cpp:18:13: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
   18 | signed main(){
      |             ^
furniture.cpp:18:13: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
furniture.cpp:18:13: warning: bad option '-fsse' to attribute 'optimize' [-Wattributes]
furniture.cpp:18:13: warning: bad option '-fsse2' to attribute 'optimize' [-Wattributes]
furniture.cpp:18:13: warning: bad option '-fsse3' to attribute 'optimize' [-Wattributes]
furniture.cpp:18:13: warning: bad option '-fssse3' to attribute 'optimize' [-Wattributes]
furniture.cpp:18:13: warning: bad option '-fsse4' to attribute 'optimize' [-Wattributes]
furniture.cpp:18:13: warning: bad option '-fpopcnt' to attribute 'optimize' [-Wattributes]
furniture.cpp:18:13: warning: bad option '-fabm' to attribute 'optimize' [-Wattributes]
furniture.cpp:18:13: warning: bad option '-fmmx' to attribute 'optimize' [-Wattributes]
furniture.cpp:18:13: warning: bad option '-ffma' to attribute 'optimize' [-Wattributes]
furniture.cpp:18:13: warning: bad option '-ftune=native' to attribute 'optimize' [-Wattributes]
furniture.cpp: In function 'int main()':
furniture.cpp:31:17: warning: unused variable 'ok' [-Wunused-variable]
   31 |         int x,y,ok=0; cin>>x>>y;
      |                 ^~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 724 KB Output is correct
2 Incorrect 8 ms 944 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 724 KB Output is correct
2 Incorrect 8 ms 944 KB Output isn't correct
3 Halted 0 ms 0 KB -