제출 #1149892

#제출 시각아이디문제언어결과실행 시간메모리
1149892modwwe드문 곤충 (IOI22_insects)C++20
컴파일 에러
0 ms0 KiB
//#include "gap.h" //#include "mushrooms.h" #include "insects.h" #pragma GCC optimize("Ofast,unroll-loops") #include<bits/stdc++.h> //#define int long long #define ll long long #define down cout<<'\n'; #define debug cout<<" cucuucucuuu",down #define modwwe int t;cin>>t; while(t--) #define bit(i,j) (i>>j&1) #define sobit(a) __builtin_popcountll(a) #define task2 "ftree" #define task "test" #define fin(x) freopen(x".inp","r",stdin) #define fou(x) freopen(x".out","w",stdout) #define pb push_back #define mask(k) (1<<k) #define checktime cerr << (double)clock() / CLOCKS_PER_SEC * 1000 << " ms"; using namespace std; #define getchar_unlocked getchar mt19937 rd(chrono::steady_clock::now().time_since_epoch().count()); int rand(int l,int r) { return uniform_int_distribution<int>(l,r)(rd); } void phongbeo(); const int inf = 1e16; const ll mod2 = 1e9+7; const ll base=67; int n, m, s1, s2, s4, s3, sf, k, s5, s6, mx, s7, s8, s9, mx2, res, dem2 = 0, dem = 0, s33, dem3, dem4, mid, l2, r2, center; int i, s10, s12,k1,k2,k3,s11,lim,w,l,r ; int kk; int t; int el = 19; main() { if(fopen(task2".inp","r")) { fin(task2); fou(task2); } if(fopen(task".inp","r")) { fin(task); fou(task); } ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); /// cin>>s1; //int t;cin>>t; while(t--) phongbeo(); // checktime }/* int c[1001]; int a[1001]; int d[1001]; void move_outside(int x) { c[a[d[x]]]--; if(c[a[d[x]]]==0&&s2==a[d[x]])s2=a[d[x]]-1; a[d[x]]--; c[a[d[x]]]++; } void move_inside(int x) { dem2++; c[a[d[x]]]--; a[d[x]]++; c[a[d[x]]]++; if(a[d[x]]>s2)s2=a[d[x]]; } int press_button() { return s2; }*/ int lower[2001]; int haha[2001]; vector<int> rollback,v; int min_cardinality(int N) { n=N; for(int i=0; i<n; i++) { move_inside(i); if(press_button()==2) move_outside(i),v.pb(i); else { dem++; dem3++; lower[i]=1; rollback.pb(i); } } l=2; r=n/dem; while(l<=r) { int mid=l+r>>1; for(int i=0; i<n; i++) if(lower[i]>mid) { lower[i]=0; dem3--; move_outside(i); } for(int i=0; i<n; i++) if(lower[i]==0) { move_inside(i); if(press_button()==mid+1) { move_outside(i); } else { dem3++; lower[i]=mid; /// pos i<=mid } } if(dem3!=dem*mid) { r=mid-1; for(int i=0; i<n; i++)if(lower[i]==0)lower[i]=-1; } else l=mid+1; } return l-1; }/* void phongbeo() { for(int i=0; i<500; i++) d[i]=i/17; for(int i=500; i<1000; i++) d[i]=i/17; s3=min_cardinality(1000); cout<<s3<<" "<<dem2; }*/

컴파일 시 표준 에러 (stderr) 메시지

insects.cpp:28:17: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+16' to '2147483647' [-Woverflow]
   28 | const int inf = 1e16;
      |                 ^~~~
insects.cpp:36:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   36 | main()
      | ^~~~
insects.cpp: In function 'int main()':
insects.cpp:15:23: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 | #define fin(x) freopen(x".inp","r",stdin)
      |                ~~~~~~~^~~~~~~~~~~~~~~~~~~
insects.cpp:40:9: note: in expansion of macro 'fin'
   40 |         fin(task2);
      |         ^~~
insects.cpp:16:23: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 | #define fou(x) freopen(x".out","w",stdout)
      |                ~~~~~~~^~~~~~~~~~~~~~~~~~~~
insects.cpp:41:9: note: in expansion of macro 'fou'
   41 |         fou(task2);
      |         ^~~
insects.cpp:15:23: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 | #define fin(x) freopen(x".inp","r",stdin)
      |                ~~~~~~~^~~~~~~~~~~~~~~~~~~
insects.cpp:45:9: note: in expansion of macro 'fin'
   45 |         fin(task);
      |         ^~~
insects.cpp:16:23: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 | #define fou(x) freopen(x".out","w",stdout)
      |                ~~~~~~~^~~~~~~~~~~~~~~~~~~~
insects.cpp:46:9: note: in expansion of macro 'fou'
   46 |         fou(task);
      |         ^~~
/usr/bin/ld: /tmp/ccReX4Qv.o: in function `main':
stub.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccnK3PW1.o:insects.cpp:(.text.startup+0x20): first defined here
/usr/bin/ld: /tmp/ccnK3PW1.o: in function `main':
insects.cpp:(.text.startup+0xd6): undefined reference to `phongbeo()'
collect2: error: ld returned 1 exit status