제출 #1099491

#제출 시각아이디문제언어결과실행 시간메모리
1099491shivamshaw23Poi (IOI09_poi)C++17
70 / 100
170 ms23888 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long int #define mod 1000000007 ll phi(ll n) { ll result = n; for (int i = 2; i * i <= n; i++) { if (n % i == 0) { while (n % i == 0) n /= i; result -= result / i; } } if (n > 1) result -= result / n; return result; } ll ncr(ll n,ll r){ if(r==0){ return 1; } ll ans=1,a=1,b=1; if(n-r<r){ r=n-r;} while(r){ a*=n; b*=r; ll g = __gcd(n,r); a/=g; b/=g; n--; r--; ans=a/b; } return ans; } ll power(ll x,ll y){ ll res=1; while(y>0){ if(y&1) res=(res*x); y>>1; x=(x*x); }return res;} int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll n,t,p;cin>>n>>t>>p; vector<int>points(t,0); vector<vector<int>>v; for(int i=0;i<n;i++){ vector<int>temp; for(int j=0;j<t;j++){ ll a;cin>>a; temp.push_back(a); } v.push_back(temp); } for(int i=0;i<n;i++){ for(int j=0;j<t;j++){ ll a=v[i][j]; points[j]+=a; } } for(int i=0;i<t;i++){ points[i]=n-points[i]; } vector<int>scores(n,0); for(int i=0;i<n;i++){ ll a=0; for(int j=0;j<t;j++){ if(v[i][j]==1){ a+=points[j]; } } scores[i]=a; } ll uwu = scores[p-1]; ll ans=0; for(int i=0;i<p;i++){ if(uwu==scores[i])ans++; } for(int i=0;i<n;i++){ if(uwu<scores[i])ans++; } cout<<uwu<<" "<<ans<<endl; }

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

poi.cpp: In function 'long long int power(long long int, long long int)':
poi.cpp:46:2: warning: statement has no effect [-Wunused-value]
   46 | y>>1; x=(x*x);
      | ~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...