제출 #60792

#제출 시각아이디문제언어결과실행 시간메모리
60792istlemin저울 (IOI15_scales)C++14
26.32 / 100
4 ms720 KiB
#include "scales.h" #include<bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i = a; i<int(b);++i) #define all(v) v.begin(),v.end() #define sz(v) v.size() #define trav(a,c) for(auto a: c) typedef long long ll; typedef vector<ll> vi; typedef pair<ll,ll> pii; vector<tuple<ll,ll,ll,ll> > heaviestOps; ll heaviest(ll a,ll b,ll c){ if(a==b||b==c||c==a) return -1; ll res = getHeaviest(a+1,b+1,c+1)-1; heaviestOps.emplace_back(a,b,c,res); return res; } vector<tuple<ll,ll,ll,ll> > lightestOps; ll lightest(ll a,ll b,ll c){ if(a==b||b==c||c==a) return -1; ll res = getLightest(a+1,b+1,c+1)-1; lightestOps.emplace_back(a,b,c,res); return res; } void init(int T) { } void orderCoins() { int coins[6] = {1,2,3,4,5,6}; rep(j,0,3){ rep(i,0,4){ ll res = getLightest(coins[i],coins[i+1],coins[i+2]); if(res==coins[i+1]) swap(coins[i],coins[i+1]); if(res==coins[i+2]) swap(coins[i],coins[i+2]); } } if(getHeaviest(coins[3],coins[4],coins[5])==coins[4]) swap(coins[4],coins[5]); //rep(i,0,6) cout<<coins[i]<<" "; //cout<<endl; answer(coins); return; /*heaviestOps.clear(); lightestOps.clear(); rep(i,0,100){ heaviest(rand()%6,rand()%6,rand()%6); } rep(i,0,100){ lightest(rand()%6,rand()%6,rand()%6); } vi W = {0,1,2,3,4,5}; do{ bool fail = false; rep(i,0,heaviestOps.size()){ ll a,b,c,res; tie(a,b,c,res) = heaviestOps[i]; if(max(W[a],max(W[b],W[c]))!=W[res]) fail = true; } rep(i,0,lightestOps.size()){ ll a,b,c,res; tie(a,b,c,res) = lightestOps[i]; if(min(W[a],min(W[b],W[c]))!=W[res]) fail = true; } if(!fail) { int ans[6]; rep(i,0,6) ans[W[i]] = i+1; answer(ans); return; } } while(next_permutation(all(W)));*/ }

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

In file included from grader.c:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (_ghksjhdfkae19ga_ > 1) 
     ^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  for (i = 0; i < 6; i++) {
  ^~~
scales.cpp: In function 'll heaviest(ll, ll, ll)':
scales.cpp:19:27: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
     ll res = getHeaviest(a+1,b+1,c+1)-1;
                          ~^~
scales.cpp:19:31: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
     ll res = getHeaviest(a+1,b+1,c+1)-1;
                              ~^~
scales.cpp:19:35: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
     ll res = getHeaviest(a+1,b+1,c+1)-1;
                                  ~^~
scales.cpp: In function 'll lightest(ll, ll, ll)':
scales.cpp:28:27: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
     ll res = getLightest(a+1,b+1,c+1)-1;
                          ~^~
scales.cpp:28:31: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
     ll res = getLightest(a+1,b+1,c+1)-1;
                              ~^~
scales.cpp:28:35: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
     ll res = getLightest(a+1,b+1,c+1)-1;
                                  ~^~
scales.cpp: In function 'void init(int)':
scales.cpp:34:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...