답안 #344763

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
344763 2021-01-06T13:52:12 Z fixikmila Money (IZhO17_money) C++14
0 / 100
5 ms 8172 KB
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,ll>pll;
typedef long double ld;
ll bin_pow(ll a,ll b){
    if(b==0)return 1;
    if(b%2==0){
        ll t=bin_pow(a,b/2);
        return t*t%MOD;
    }
    else return a*bin_pow(a,b-1)%MOD;
}
int main()
{
    //freopen("stones.in","r",stdin);
    //freopen("stones.out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
    cin>>n;
    vector<ll>a(n),pos(1000001,-1),b;
    for(int i=0;i<n;i++)cin>>a[i];
    b=a;
    sort(b.begin(),b.end());
    while(true){
        for(int i=0;i<n;i++){
            if(a[i]==b[l]){
                l++;
                if(l==n)break;
            }
        }
        ans++;
        if(l==n)break;
    }
    cout<<ans;
    return 0;
}

Compilation message

money.cpp: In function 'int main()':
money.cpp:21:8: warning: unused variable 't' [-Wunused-variable]
   21 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |        ^
money.cpp:21:14: warning: unused variable 'm' [-Wunused-variable]
   21 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |              ^
money.cpp:21:16: warning: unused variable 'k' [-Wunused-variable]
   21 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |                ^
money.cpp:21:20: warning: unused variable 'sum' [-Wunused-variable]
   21 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |                    ^~~
money.cpp:21:30: warning: unused variable 'r' [-Wunused-variable]
   21 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |                              ^
money.cpp:21:34: warning: unused variable 'x' [-Wunused-variable]
   21 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |                                  ^
money.cpp:21:38: warning: unused variable 'y' [-Wunused-variable]
   21 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |                                      ^
money.cpp:21:42: warning: unused variable 'z' [-Wunused-variable]
   21 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |                                          ^
money.cpp:21:52: warning: unused variable 'mn' [-Wunused-variable]
   21 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |                                                    ^~
money.cpp:21:65: warning: unused variable 'mx' [-Wunused-variable]
   21 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |                                                                 ^~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 8172 KB Output is correct
2 Incorrect 5 ms 8172 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 8172 KB Output is correct
2 Incorrect 5 ms 8172 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 8172 KB Output is correct
2 Incorrect 5 ms 8172 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 8172 KB Output is correct
2 Incorrect 5 ms 8172 KB Output isn't correct
3 Halted 0 ms 0 KB -